2015-06-23 61 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; 
     }); 
    } 
    }; 
}); 
相關問題