# Category: angular-ui-router

## How to define click event on click and href event when user opens a new tab

This is very specific requirement but was wondering if this is possible. I have a header menu, “Create Report”. I had defined “click” event for this. On clicking this menu, it opens a new modal, without changing the route.. and once user feeds some data there and clicks submit, it changes the route to “/reports” and shows the data. But problem with this approach is, when user want to open this link in new tab […]

How to load the data from an external JSON file in Webix tree component. I have tried with $http method of AngularJS but Webix components are not setting the response of http service as their data parameter. Source: AngularJS ## Angular js routing issues with transitions how could that be eliminated > transition suspended,prevented,aborted,failed in angular ui-routing….. anyone could you please help me?….I am using angular 1.6.4 version and ui-router’s version is v0.2.18….js var app=angular.module(‘app’, [‘ui.router’]) app.config([‘$qProvider’, functi;on ($qProvider) { ‘use strict’;$qProvider.errorOnUnhandledRejections(false); }]) Source: AngularJS

this routing working fine on loaclhost. but when I deploy my application on server and refresh any page it shows error of 404 error page not found. below is my routing $routeProvider .when(“/”, { templateUrl: “/views/login.cshtml” }) .when(“/Login”, { templateUrl: “/Views/login.cshtml” }) .when(“/adminlogin”, { templateUrl: “/views/login.cshtml” }) .when(“/Register”, { templateUrl: “/Views/Register.cshtml” }) .when(“/blue”, { templateUrl: “blue.htm” }).otherwise(‘/’, { redirectTo: ‘/’ });$locationProvider .html5Mode(true) anyone knows the solution kindly share. Source: AngularJS

## how to give controller a name in a directive in Angular

So it might be a simple question. I have a directive defined this way: angular .module(‘ui-abc’, [ ‘xyz’]) .directive(‘computer’, compute); function compute( item) { return { restrict: “EA”, templateUrl: ‘../elements/src/template.html’, scope:{ qwerty : ‘=’,} controller: [‘$scope’,’$sce’, { ……… } The controller does not have a name, how can i add one ? I need this name so that I can refer to that controller inside my ui-router configuration. I tried to do this function compute( […]

## How do I read URL params after hash with Angularjs?

We use Angularjs 1.5, ui-router and html5mode turned on in our e-commerce app. Parsing URL of this kind: https://whatever-domain/products/product?code=123&variant=456&dealerId=789 works fine. Recently we got use case when we have URL terminated on the backend side with parameter after hash, i.e. https://whatever-domain/products/product?code=123&variant=456&dealerId=789#vehicleId=100200. And ui-router cannot read this “#vehicleId=100200” assuming that is anchor (not sure). There is NO way for backend to deliver it as “&vehicleId=100200” for reasons they say. Dear Angular guys, is there any valid […]

## are these ui-sref states ie11 friendly

When trying to navigate with IE11, the links do not work with a state such as url: ‘/main-category/:id’ but the “parent” state url: ‘/:main-category/’ works fine. These are not true nested or parent-child since they don’t actually share any common views/html template, except for navigation. I found this meta tag suggestion and this IE events suggestion, but neither seem to be providing a solution for why my navigation bar AND links from another state do […]