Angular.js错误:多个指令[tagManager,tagManager]要求隔离范围

时间:2013-10-02 11:19:22

标签: javascript angularjs angularjs-directive gruntjs yeoman

我已经制作了一个Angular.js应用,并使用Grunt搭建了yeoman版本。该应用程序在开发中运行良好,但是当我构建并部署到登台服务器时,我在所有指令(自己和第三方)上都会出错:示例

Error: Multiple directives [tagManager, tagManager] asking for isolated scope on: <tag-manager tags="profile.styles" class="ng-isolate-scope ng-scope">

Error: Multiple directives [gender, gender] asking for template on: <gender value="profile.gender">

我认为指令很好,因为它们在开发中工作,但是(yeoman)构建中发生了什么?

此处参考是一个指令(在咖啡脚本中)

angular.module('clientApp')
  .directive 'gender', [->
    template: '<span><i class="{{icon}} {{color}}"></i></span>'
    restrict: 'EA'
    scope:
      value: '=',
    link: (scope, element, attrs) ->
      if scope.value is 'male'
        scope.icon = 'icon-male'
        scope.color = 'blue_fg'
      else
        scope.icon = 'icon-female'
        scope.color = 'pink_fg'
  ]

0 个答案:

没有答案