所以经过插件初始化我使用MaterializeCSS,并有这段代码:AngularJS NG重复
<select>
<option value="" disabled selected>Jump To Season</option>
<option option-item ng-repeat="item in series.seasons" value="{{item.id}}">
{{item.name}}
</option>
</select>
和IM使用此指令:
.directive("optionItem", [function() {
return {
restrict: 'A',
link: function (scope, element) {
if (scope.$last) {
$('select').material_select();
}
}
};
}]);
现在的元素并重复多次根据需要,但不是显示$ scope.item.name值,而是将{{item.name}}显示为纯文本,而不是表达式值。我如何克服这个挫折?我尝试过使用Material Angular md-select,但是我也遇到过它的问题,每次点击选择我都无法点击网页上的任何内容,也没有任何反应。
重要提示: 的series.seasons阵列通过AJAX调用取出。
看到这个:http://stackoverflow.com/questions/12371159/how-to-get-evaluated-attributes-在一个自定义指令 – Soggiorno
重复你在http://jsfiddle.net/ – vorant