第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

AngularJS 1.2 $注入器:modulerr

AngularJS 1.2 $注入器:modulerr

AngularJS 1.2 $注入器:modulerr當(dāng)使用角度1.2而不是1.07時,下面的代碼不再有效,為什么?'use strict';var app = angular.module('myapp', []);app.config(['$routeProvider', '$locationProvider',     function($routeProvider, $locationProvider) {         $locationProvider.html5Mode(true);         $routeProvider.         when('/', {             templateUrl: 'part.html',             controller: 'MyCtrl'         }).         otherwise({             redirectTo: '/'         });     }]);問題出在注入器配置部分(app.config):Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.0rc1/$injector/modulerr?p0=muninn&p1=Error%…eapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.0rc1%2Fangular.min.js%3A31%3A252)如果我沒記錯的話,這個問題始于angular 1.1.6。
查看完整描述

3 回答

?
精慕HU

TA貢獻(xiàn)1845條經(jīng)驗 獲得超8個贊

我的錯誤在最后添加'()'消失了

(function(){
    var home = angular.module('home',[]);

    home.controller('QuestionsController',function(){
        console.log("controller initialized");
        this.addPoll = function(){
            console.log("inside function");
        };
    });})();


查看完整回答
反對 回復(fù) 2019-08-06
?
www說

TA貢獻(xiàn)1775條經(jīng)驗 獲得超8個贊

還有一件事要添加到列表中,因為這是谷歌搜索“錯誤:[$ injector:modulerr] angular”的第一個結(jié)果:

如果您的'index'html'中的應(yīng)用名稱與主javascript應(yīng)用定義中的應(yīng)用名稱不匹配,則也會產(chǎn)生此錯誤。

例如,如果您的HTML看起來像這樣:

    </head>
    <body ng-app="myWebSite">

        <!-- My Web Site -->
        <p>About my web site...</p>

        etc ...

你的JavaScript看起來像這樣(即應(yīng)用程序名稱上有拼寫錯誤 - myWebCite而不是myWebSite):

/** Main AngularJS Web Application */ var app = angular.module('myWebCite', [ 'ngRoute' ]); /** Configure the Routes */ app.config(['$routeProvider', function ($routeProvider) { 
  etc ...

然后還會生成'錯誤:[$ injector:modulerr] angular'錯誤。


查看完整回答
反對 回復(fù) 2019-08-06
  • 3 回答
  • 0 關(guān)注
  • 717 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號