-
Thiago Custodio
angularjs angularjs-routing
I’m trying to do a simple TODO sample with angular.js (using routes). I could open the form to create a New Task, but when I click on “Back” button (after create a new one), it always crashes my browser.I’ve tried config the ‘/’ route and use .otherwise too, but I’m still getting the same result.What I’m doing wrong?//listTasks.htm<!DOCTYPE html><html data-ng-app=”appTodoList”><head><title>TODO List</title></head><body><div data-ng-controller=”TodoCtr
-
olleicua
javascript jquery angularjs angularjs-routing
I’m trying to get set up an angularJS app with jQuery and I’m using the angular routing system for urls doing something like the following:var app = angular.module(‘app’, []);app.config(function($routeProvider) {$routeProvider.when(‘/start_page’, {templateUrl: ‘path/to/template’,controller: ‘StartPageController’});$routeProvider.when(‘/container/:container/thing/:thing’, {templateUrl: ‘path/to/template’,controller: ‘ThingsInContainersController’});$routeProvider.otherwise({ redirectTo: ‘/start_p
-
Stephane Rolland
angularjs angularjs-routing
I am trying to learn the route features of angularJS, but what I have happened so far doesn’t work. If I ever click Load, Display, or Play (in my example: the links to possible action urls) then <div ng-view></div> still exist in the DOM (when I inspect it) , moreover it is not replaced by the related html partial file as indicated in the templateUrl of the route provider.The Chromium log console displays an error: Uncaught ReferenceError: LoadCtrl is not defined from my_appIf I put
-
XåpplI’-I0llwlg’I –
angularjs angularjs-routing angularjs-module
In Angular 1.2, ngRoute is a separate module so you can use other community routers like ui.router instead.I’m writing an open-source module that aims to work for multiple different router implementations. So how can I check which router is loaded or exists?I’m doing the following inside a factory in my module, but it does not work the way I expect it to:if (angular.module(“ngRoute”))// Do ngRoute-specific stuff. else if (angular.module(“ui.router”))// Do ui.router-specific stuff.It raises an er
-
t00f
angularjs angularjs-routing
I read a lot about lazzy loading, but I am facing a problem when using $routeProvider.My goal is to load a javascript file which contains a controller and add a route to this controller which has been loaded previously.Content of my javascript file to loadangular.module(‘demoApp.modules’).controller(‘MouseTestCtrlA’, [‘$scope’, function ($scope) {console.log(“MouseTestCtrlA”);$scope.name = “MouseTestCtrlA”; }]);This file is not included when angular bootstap is called. It means, I have to load t
-
Andrej Slivko
url routing angularjs angularjs-routing
In .NET MVC there is @Url.Action() and in RoR there is url_for()I could not find similar url building helper in angularjs.I’m already providing everything that is needed to build url to $routeProvider so something like: $routeProvider.urlFor(“MyCtrl”, {id: 5}) could be nice to have.My main goal here is to avoid hardcoded urls in viewes and other places and to avoid repeating url/routes patterns twice.UPDATE:Seems like it’s hard to explain what i want so here is exact example of what i want:Inste
-
RickCigarette
angularjs angularjs-routing angularjs-service
I have specific viewing states that I want users to be able to link to.I’m trying to route a controller to a specific state of the page when a user goes to http://localhost:3000/resource/#!/1 My configuration is:$routeProvider.when(‘/:memberId’, {controller: ‘MemberDetailsCtrl’});$locationProvider.html5Mode(false).hashPrefix(‘!’);I’ve been experimenting a lot and it seems like $route is undefined until all the scopes are done generating. That means I can’t execute$http.get(‘/resource/’ + $route.
-
vzhen
angularjs angularjs-routing
I have a dynamic value params in url and I want to get it and use in controller when onload But I have no idea how to deal with $route.current.paramsLet say I have this route provider$routeProvider.when(‘foo/:bar’, {templateUrl: ‘template.html’};Then in my controllerapp.controller(‘mapCtrl’, function($scope, $route, $routeParams) {var param = $route.current.params.bar;console.log(param);});If user access foo/abcdefg suppose should show abcdefg in console but I got error. ‘Cannot read property ‘p
-
Martin
angularjs angularjs-routing
I was trying to use an ng-select to display 1 toolbar or another, i pointed this at my controller where I am doing$scope.toolbarType = $route.current.toolbarType;Problem is that the $route.current is undefined. I am not 100% sure why, searching google it appears that the route is not built when I land in my controller.Anyone know why its happening ?Is there an alternative I can use ?Should I be using eventing for example ??Should I point my ng-select at a controller that listens for an event an
-
dnc253
angularjs angularjs-routing
Is there any way to make a server hit to retrieve data before setting up all the routes on the $routeProvider? I want to be able to dynamically setup routes based on this remote data. I tried something like this:angular.module(“myApp”).config([“$routeProvider”, “$http”, function($routeProvider, $http) {$http.get(“myData”).success(function(data) {$routeProvider.when(data.dynamicRoute, {//route definition}//or$routeProvider.when(“/known/route”, {redirectTo: data.dynamicRoute}}); }]);but that resul