【发布时间】:2013-10-18 13:48:29
【问题描述】:
我在两个单独的文件中有两个模块:
first.js
var app = angular.module('first',['ngGrid']);
app.controller('firstTest',function($scope))
{
...
});
second.js
var app = angular.module('second',['ngGrid']);
app.controller('secondTest',function($scope))
{
...
});
我现在想在导航类型视图中再次使用这两个模块:
tabs.js
var app = angular.module('myTabs',['first','second']);
$scope.tabs = [
{title: "first", content:first.firstTest},
{title: "second", content:second.secondTest},
];
$scope.navType='pills';
});
发生的情况是我收到以下错误:
unknown provider firstProvider <- first
所以我的问题是
1) 这是进行选项卡式导航的正确方法吗
2) 处理first 和second 模块注入的正确技术是什么?
【问题讨论】:
标签: javascript angularjs model-view-controller dependency-injection