"Error: [ng:areq] Argument 'keywords' is not a function, got undefined"
代碼類似這樣的:
<div ng-app="xxxx" ng-controller="xxxx"> //... </div>
var app = angular.module("xxxx", []); app.controller('xxxx', function ($scope, $http, $state) {});
本來應該不會有問題,但是經過路由配置之后,就出現了這樣的問題,我完全就是新建了一個頁面,
然后復制一下html和js文件而已,怎么會報錯呢...結果問了下對Angular熟悉的人才知道:該這么配置...
第一種解決方案:要么在路由配置那里寫入:
var app = angular.module('app', ["old_1", "old_2", "old_3", "xxxx"]);
第二種解決方案:要么修改新建的頁面和js:
<div ng-controller="xxxx"> //... </div>
app.controller('xxxx', function ($scope, $http, $state) {});
好吧、我選的第二種,能擴展的別修改,GG。。。