包括HTML中的ui-router.js无效

时间:2016-09-01 14:48:03

标签: javascript angularjs angular-ui-router

我是angularjs的新手,我正在使用ui-router但它会抛出错误:$ injector:modulerr 控制台中的模块错误。

错误是什么? 我也包括了剧本。

var app = angular.module("SearchAPP", ['ngRoute', 'bw.paging', 'ui.router']);

app.config(['$stateProvider',
  function($stateProvider) {
    var helloState = {
      name: 'tab1',
      url: '/tab1/',
      template: '<h3>hello world!</h3>'
    }

    var aboutState = {
      name: 'tab2',
      url: '/tab2',
      template: '<h3>hello world!</h3>'
    }

    $stateProvider.state(helloState);
    $stateProvider.state(aboutState);
  }
]);
<html>

<head>
</head>

<body ng-app="myApp">
  <a ui-sref="hello">Hello</a>
  <a ui-sref="about">About</a>

  <ui-view></ui-view>
</body>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular-route.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-sanitize.js"></script>
<script src="//npmcdn.com/angular-ui-router@0.3.1/release/angular-ui-router.js">
 
 </html>

0 个答案:

没有答案