Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 角度导航(编辑项目列表)--不工作_Angularjs_Ionic - Fatal编程技术网

Angularjs 角度导航(编辑项目列表)--不工作

Angularjs 角度导航(编辑项目列表)--不工作,angularjs,ionic,Angularjs,Ionic,我是爱奥尼亚/安格拉尔JS的初学者。 在windows 10上开发侧菜单应用程序。 我从SQLite上的select语句填充了一个页面。 我要通过使用状态参数导航到编辑页面来编辑单个项目,但不响应。非常感谢您的帮助: <a href="#/edit/{{task.id}}" class="item" ng-repeat="task in Ourdata"> <h2>{{task.id}}</h2> <p>{{task

我是爱奥尼亚/安格拉尔JS的初学者。 在windows 10上开发侧菜单应用程序。 我从SQLite上的select语句填充了一个页面。 我要通过使用状态参数导航到编辑页面来编辑单个项目,但不响应。非常感谢您的帮助:

<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',
      controller: 'MyCtrl'
     });
    $urlRouterProvider.otherwise('/list');
})
在控制器中:

.controller('MyCtrl', function($stateParams){
    var taskId = $stateParams.taskId;
});