If we have an array in AngularJS, how do I clear its content?
Answer
If we have an array, ex.
$scope.itemarray = ['A', 'B', 'C'];
If we would like to clear its content in specific situation, what we need to do is as bellowing:
$scope.itemarray.length = 0;
No comments:
Post a Comment