我正在尝试在删除请求成功时加载表单,如下所示
$scope.delete = function (id) {
if (confirm("Are you sure you want to delete this record?")) {
var url = 'http://localhost/AwtCW2012002/api/restApiController/question.json/'+id;
$http({
method: 'DELETE',
url: url,
})
.success(function() {
$state.go(app.addEditQuestion);
})
我在控制器中注入了状态
angular.module('app', []).controller('questionEditCtrl', ['$state','$scope', '$http', function ($state,$scope, $http) {
我得到的错误是
Error: [$injector:unpr] http://errors.angularjs.org/1.5.0-rc.0/$injector/unpr?p0=%24stateProvider%20%3C-%20%24state%20%3C-%20questionEditCtrl
at Error (native)
at http://localhost/AwtCW2012002/assets/js/angular.min.js:6:421
at http://localhost/AwtCW2012002/assets/js/angular.min.js:42:203
at Object.d [as get] (http://localhost/AwtCW2012002/assets/js/angular.min.js:40:175)
at http://localhost/AwtCW2012002/assets/js/angular.min.js:42:265
at d (http://localhost/AwtCW2012002/assets/js/angular.min.js:40:175)
at Object.e [as invoke] (http://localhost/AwtCW2012002/assets/js/angular.min.js:40:445)
at L.instance (http://localhost/AwtCW2012002/assets/js/angular.min.js:84:168)
at v (http://localhost/AwtCW2012002/assets/js/angular.min.js:63:446)
at g (http://localhost/AwtCW2012002/assets/js/angular.min.js:56:341)(anonymous function) @ angular.min.js:111(anonymous function) @ angular.min.js:84m.$apply @ angular.min.js:138(anonymous function) @ angular.min.js:20e @ angular.min.js:40c @ angular.min.js:19zc @ angular.min.js:20be @ angular.min.js:19(anonymous function) @ angular.min.js:303j @ jquery-1.11.3.min.js:2k.fireWith @ jquery-1.11.3.min.js:2m.extend.ready @ jquery-1.11.3.min.js:2J @ jquery-1.11.3.min.js:2
gridView:77 GET http://localhost/AwtCW2012002/views/Images/BackgroundImage.jpg 404 (Not Found)
app.js
var app = angular.module('app', ['ui.router', 'ngTable', 'ngRoute', 'ngResource', 'ui.bootstrap', 'questionAddCtrl', 'questionEditCtrl']);
app.config(['$stateProvider', '$urlRouterProvider', '$routeProvider', '$locationProvider', function ($stateProvider, $urlRouteProvider, $routeProvider, $locationProvider) {