我尝试在我的网络应用程序中使用角度ui-router但我有问题.
这是app目录:
原文链接:https://www.f2er.com/angularjs/140441.html这是app目录:
test-app |_ bower-component |_ app |_ views |_ index.html |_ scripts |_ app.js
在app.js中:
angular .module('testApp',[ 'ngAnimate','ngAria','ngCookies','ngMessages','ngResource','ui.router','ngSanitize','ngTouch' ]) .config(['$stateProvider','$urlRouterProvider',function ($stateProvider,$urlRouterProvider) { $urlRouterProvider.otherwise('/'); $stateProvider .state('home',{ url: '/',templateUrl: 'index.html',controller: 'MainCtrl' }) . . .
但是当我运行应用程序时,我在控制台上收到此错误:
WARNING: Tried to load angular more than once