How to get checkbox value in angularjs?

后端 未结 4 648
故里飘歌
故里飘歌 2021-01-04 09:00

I have a 10(or n)checkbox in my ng-view. Now I would like to ask here that What is the most efficient or simple way to check if checkbox is checked and if checked get the v

4条回答
  •  情深已故
    2021-01-04 09:45

    You could simply use angular filter here, also your ng-model should be album.Selected instead of folder.Selected

    Html

    {{(albums | filter : { Selected: true }: true)}}
    

    Controller

    $scope.albumNameArray = $filter('filter')($scope.albums, { Selected: true }, true);
    

    Before using it in controller don't forget to add $filter in your controller

提交回复
热议问题