angularjs - angular navigation (editing items list)--NOT WORKING -
i beginner on ionic/angularjs. developing side menu app on windows 10. populated page select statement on sqlite. , i'm edit individual item navigating edit page using state params not responding. many kind assistance:
<a href="#/edit/{{task.id}}" class="item" ng-repeat="task in ourdata"> <h2>{{task.id}}</h2> <p>{{task.name}}</p> </a>
.config(function($stateprovider, $urlrouterprovider){ $stateprovider .state('list',{ url: '/list', templateurl: 'templates/list.html' }) .state('edit',{ url: '/edit:taskid', templateurl: 'templates/edit.html' }); $urlrouterprovider.otherwise('/list'); })
you should insert slash /
before :
i edited , add controller it:
.config(function($stateprovider, $urlrouterprovider){ $stateprovider .state('list',{ url: '/list', templateurl: 'templates/list.html' }) .state('edit',{ url: '/edit/:taskid', templateurl: 'templates/edit.html', controller: 'myctrl' }); $urlrouterprovider.otherwise('/list'); })
in controller:
.controller('myctrl', function($stateparams){ var taskid = $stateparams.taskid; });
Comments
Post a Comment