我有一个导航栏组件:
.component('navbar', {
templateUrl: 'app/common/navbar/navbar.html',
controller: NavbarController,
bindings: {
state: '<',
weekLabel: '<'
}
})
/** @ngInject */
function NavbarController () {
}
<div class="header">
<h3 class="text-muted">
Vaccine Stock Dashboard
<span ng-if="$ctrl.state"> - </span>
<span class="qa-state-label" ng-bind="$ctrl.state | uppercase"></span>
<span ng-if="$ctrl.weekLabel"> - </span>
<span class="qa-week-label" ng-bind="$ctrl.weekLabel"></span>
<a class="pull-right" ng-link="['NewStockCount']">
<i class="fa fa-plus"></i>
Add Stock Count
</a>
</h3>
</div>
测试运行良好,ng-link="['NewStockCount']"
但如果我添加它会失败并出现错误
ReferenceError:找不到变量:地图(第 2166 行)RouteRegistry@/home/femi/fielded/nav-integrated-state-dashboard/bower_components/bower-angular-router/angular1/angular_1_router.js:2166:30
我该如何纠正它以使其通过ng-link