I have started to learn angularjs, I am trying to insert new values on button click with existing scope. I have one button in my page,whenever I click that button $scope.options method triggered some datas need to be added into a scope variable to use it on ng-repeat.
For first click its adding directly because there is no-existing data. When I click next time new values should be added with existing scope.
Here is what i have tried,
$scope.options=function(options){
//$scope.datas=[];
//$scope.datas.push(options);
//$scope.datas = $scope.datas.concat(options)
$scope.datas=options;
console.log($scope.datas);
}
For first click of button my scope looks like this,
$scope.datas=["IARZ1DS099","CATL0DS32","IARZ1DS13","IATL0DS099","CARZ1DS099"];
Can anyone let me know how can I do it? Thanks in Advance!