【发布时间】:2015-10-19 23:04:42
【问题描述】:
尝试在 Angular 中使用状态路由器:
var app =angular.module('myapp', ['ui.bootstrap','ui.router']);
app.controller('TabsDemoCtrl', function ($scope, $window) {
$scope.tabs = [
{ title:'Orders', content:'Dynamic content 1' },
{ title:'Awaiting settlement', content:'Dynamic content 2' },
{ title:'Complete', content:'Dynamic content 3' }
];
});
app.config(function($stateProvider,$state) {
// Now set up the states
$stateProvider
.state('orders', {
templateUrl: '../partials/orders.html',
controller: 'ordersCtrl'
});
$state.go('orders');
});
我收到此错误:
Uncaught Error: [$injector:modulerr] Failed to instantiate module WIP due to:
Error: [$injector:unpr] Unknown provider: $state
【问题讨论】:
标签: javascript angularjs angular-ui-router angular-ui angularjs-routing