您的位置:首頁技術文章
文章詳情頁

angular.js使用ui-router注入報錯,附報錯圖

瀏覽:146日期:2024-09-18 18:29:24

問題描述

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’} }})})

項目結構圖如下:angular.js使用ui-router注入報錯,附報錯圖

報錯提示:angular.js使用ui-router注入報錯,附報錯圖

沒發現邏輯上有什么問題,麻煩看看因為什么以上程序段報錯

問題解答

回答1:

你這個錯誤是標點符號的錯啊,看看引號 逗號啥的,不一定在這段程序里

回答2:

模塊依賴注入報錯...如果不熟悉,不要使用壓縮包,直接引用源碼,會更容易排查問題。

回答3:

這個程式看起來沒有什么問題,angularjs對大小寫比較敏感還有就是全角與半角狀態

国产综合久久一区二区三区