2015-06-23 58 views
0

点击我创建类似于图像中添加的行。每次我将有相同的模式相同的行。下拉值应该选择使用AngularJs ng选项

enter image description here 我怎样才能从行

+0

我们怎样才能引导选择选择的值没有看到你的代码? – Vineet

+0

没有图片...请添加一些代码或创建一个plnkr –

回答

1
Its just a sample to get to your need. 

.js file.. 

angular.module('nonStringSelect', []) 
.run(function($rootScope) { 
    $rootScope.model = { id: 2 }; 
}) 
.directive('convertToNumber', function() { 
    return { 
    require: 'ngModel', 
    link: function(scope, element, attrs, ngModel) { 
     ngModel.$parsers.push(function(val) { 
     return parseInt(val, 10); 
     }); 
     ngModel.$formatters.push(function(val) { 
     return '' + val; 
     }); 
    } 
    }; 
}); 
相关问题