angularjs - Unable to navigate to a state -
I have defined an editing status / edit and when I click on Editing D1, it will not be root < / P>
& lt; A ng-href = "# / Example / Edit" & gt; Translation D1 & lt; / A & gt;
JS
routerApp.config (function ($ state provider, $ urlRouterProvider) {$ urlRouterProvider.otherwise ('/ home'); $ stateProvider State ('home', {url: '/ home', templateUrl: 'instance-view.html', administrator: 'instanceListController'}) .state ('instance', {url: '/ instance', abstract: true, Template: '& lt; ui-view / & gt;'}) .state ('instance.detail', {url: '/: id', templateUrl: 'data-view.html', Controller: 'specDataListController'} ) .state ('Instance.edit', {url: '/ edit', templateUrl: 'edit-table.html', Controller: 'editInstanceController'});
});
Plnkr:
As noted by the router, editing as an id And will never hit / edit.
By using a numeric value for your ID and following your route to:
url: '/ {id: [0-9] {1,8} }} '
or you can join the ID in which non-numeric characters and views /: id and edit /: id:
.state ('Instance.detail', {url: '/ view /: id', templateUrl: 'Data-view.html', Controller: 'specDataListController'}) .state ('instance.edit', {url: '/ edit /: Id ', templateUrl:' edit-table.html ', Controller:' editInstanceController '});
You also need to update your link in your thoughts.
Check Me
Comments
Post a Comment