模块仅在Safari中不可用

时间:2017-05-01 01:17:50

标签: angularjs angular-ui-router

我正在试图找出为什么myApp.adverts模块不能在Safari上使用。我用angular-seed开始一个项目。在Chrome和Firefox上一切正常。

app.js

'use strict';

angular.module('myApp', [
  'ui.router',
  'myApp.homepage',
  'myApp.adverts',
  'myApp.version'
])
.config(['$urlRouterProvider', '$stateProvider', function($urlRouterProvider, $stateProvider) {
  $urlRouterProvider.otherwise('homepage');
}]);

主页/ homepage.js

'use strict';

angular.module('myApp.homepage', ['ui.router'])

.config(['$stateProvider', function($stateProvider) {
  $stateProvider.state('homepage', {
    url:         '/homepage',
    templateUrl: 'homepage/homepage.html',
    controller:  'HomepageCtrl'
  });
}])

.controller('HomepageCtrl', [function() {
}]);

广告/ adverts.js

'use strict';

angular.module('myApp.adverts', ['ui.router'])

.config(['$stateProvider', function($stateProvider) {
  $stateProvider.state('adverts', {
    url:         '/adverts',
    templateUrl: 'adverts/adverts.html',
    controller:  'AdvertsCtrl'
  });
}])

.controller('AdvertsCtrl', [function() {
}]);

的index.html

...
<div ui-view></div>
...
<script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="app.js"></script>
<script src="homepage/homepage.js"></script>
<script src="adverts/adverts.js"></script>
...

0 个答案:

没有答案