指令不适用于所选指令

时间:2015-04-26 10:14:34

标签: angularjs angularjs-directive

我写了一个简单的指令,如:

myApp.directive('input', function () {
    return {
        restrict: 'E',
        //scope: false,
        link: function (scope, elem) {
            if (scope.lang && elem.attr('type') === 'text') {
                elem.attr('lang', 'fa');
                console.log(scope.lang);
            }
        }
    };
});  

它工作正常,但它不适用于选择的输入搜索?
任何的想法?谢谢

enter image description here

0 个答案:

没有答案