相关疑难解决方法(0)

Angular Directive不评估ng-repeat内部

我有以下设置:

应用程序/指令

var app = angular.module("MyApp", []);

app.directive("adminRosterItem", function () {
    return {
        restrict: "E",
        scope: {
            displayText: "@"
        },
        template: "<td>{{ displayText }}</td>", // should I have this?
        link: function(scope, element, attrs){
            // What do I put here? I don't seem to have any
            // element to initialize (set up event handlers, for example)
        },
        compile: function(?,?,?){} // should I have this? If so, what goes inside?
    }
});
Run Code Online (Sandbox Code Playgroud)

调节器

function PositionsController($scope) {
           $scope.positions = [{ Name: "Quarterback", Code: …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-directive angularjs-ng-repeat

10
推荐指数
2
解决办法
3万
查看次数