Please provide an active plunker <http://plnkr.co/> or other live representation of your problem. It is hard to debug when half of your code is missing (50% of the problems on this list tend to come from not properly declaring module dependencies early on in the bootstrapping process).
That said, I use <a ui-sref="app.foo.bar"> style links all the time, so I bet there's some kind of bootstrapping or declaration problem. e One thing you might need to do is On Fri Dec 19 2014 at 7:34:40 AM Sharad Goyal <[email protected]> wrote: > I have a problem with angular routing. I am trying to load the page > through s-ref but it does not work, however if I specify through router it > goes and open the page. Please help. > > <a ui-sref="app.project.detail" class="btn btn-sm btn-success">Project > title</a> > > > Router configuration > > angular.module('app') > .run( > [ '$rootScope', '$state', '$stateParams', > function ($rootScope, $state, $stateParams) { > $rootScope.$state = $state; > $rootScope.$stateParams = $stateParams; > } > ] > ) > > // Research Project > .state('app.project', { > abstract: true, > url: '/project', > templateUrl: 'tpl/project/research_list.html', > // use resolve to load other dependences > resolve: { > deps: ['uiLoad', > function( uiLoad ){ > return uiLoad.load( > ['js/app/project/project.js'] ); > }] > } > }) > .state('app.project.list', { > url: '/list', > templateUrl: 'tpl/project/research_list.html' > }) > .state('app.project.detail', { > url: '/detail', > controller: 'ProjectCtrlNew', > templateUrl: 'tpl/project/research_detail.html' > }) > .state('app.project.new', { > url: '/new', > templateUrl: 'tpl/project/research_detail.html' > }) > .state('app.project.edit', { > url: '/edit/{project}', > templateUrl: 'tpl/project/research_detail.html' > }) > > Project js controller > app.controller('ProjectCtrlList', ['$scope', '$http', '$stateParams', > function($scope, $http, $stateParams) { > $http.get('rest/research').then(function (resp) { > $scope.projects = resp.data; > } > ); > }]); > > app.controller('ProjectCtrlNew', ['$scope', function($scope) { > alert("hello"); > }]); > > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
