控制器和指令在同一元素上请求隔离范围

Controller and Directive requesting isolated scope on the same element

尝试在元素上添加 ng-intro-options 属性时遇到问题

代码

var App = angular.module('MyApp', ['infinite-scroll', 'angular-intro']);
App.controller('MyController', ['$scope', function($scope){
    $scope.IntroOptions = {}
}]);

和HTML

<body ng-controller="MyController" ng-intro-options="IntroOptions">

但是 AngularJS 抛出错误提到 URL:

http://docs.angularjs.org/error/$compile/multidir

当我在 body 标签上添加 angular-intro 的 attr 时,就会抛出错误。我正在使用 angular 1.3.5

最新版本 angular 有问题,不是稳定版本。

这个问题甚至可以在 angular 1.3.0

中重现

它与稳定版本 https://code.angularjs.org/1.2.27/angular.js 一起正常工作。

angular 1.2.27 Fidlle 按预期工作。

angular 1.3.0 and above Fidlle 给出一些错误,就像你得到的一样。检查控制台

切换回稳定版即可解决您的问题。

希望对您有所帮助。