New to Angular JS,
I trying to define custom directive for dropdown with data from web service.
Now trying to do with some static data but not working.
app.directive("deviceBranch", function(){
return {
templateUrl : 'resources/view/template/device-branch-list.html',
controller : function($scope) {
$scope.listBranch = [{
deviceBranchId:"id1",
deviceBranchName:"value1"
},{
deviceBranchId:"id2",
deviceBranchName:"value2"
},{
deviceBranchId:"id3",
deviceBranchName:"valkue3"
}]
}
}
});
Added "Select" in the template with-
ng-options="service.deviceBranchId as service.deviceBranchName for service in listBranch"
This is how I am using directive
<device-branch></device-branch>
Select is populated, but no options are available.
Please assist.