search

Home  >  Q&A  >  body text

angular.js uses ui-router injection to report errors, with error pictures attached

var esmsApp = angular.module('esmsApp', [
    // 外部库模块
    'ui.router'
]);

esmsApp.config(function($stateProvider, $urlRouterProvider) {

    $urlRouterProvider.otherwise('/index');
    $stateProvider
        .state('index', {
            url: '/index',
            views: {
                '': {
                    templateUrl: '../view/index.html'
                },
                'header@index': {
                    templateUrl: '../view/header.html'
                },
                'content@index': {
                    templateUrl: '../view/content.html'
                },
                'footer@index': {
                    templateUrl: '../view/footer.html'
                },
                'modal@index': {
                    templateUrl: '../view/modal.html'
                }

            }
        })
})

The project structure diagram is as follows:

Error message:

I didn’t find any problem with the logic. Please check why the above program segment reported an error

phpcn_u1582phpcn_u15822839 days ago661

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-05-15 17:13:56

    Your mistake is a punctuation mistake. Look at the quotation marks, commas, etc., they may not be in this program

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-15 17:13:56

    Module dependency injection error...
    If you are not familiar with it, do not use the compressed package and directly quote the source code, which will make it easier to troubleshoot the problem.

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-15 17:13:56

    There seems to be no problem with this program. Angularjs is more case-sensitive and has full-width and half-width status

    reply
    0
  • Cancelreply