javascript - How to convert AngularJS scope object into simple JS array? -
how convert angularjs scope object simple js array? this function checks if checkbox checked , adds corresponding value object. want transfer object values array , alert after press button. result undefined, why? var formapp = angular.module('formapp', []) .controller('formcontroller', function($scope) { // store our form data in object $scope.formdata = {}; }); var array = object.keys(formdata).map(function(k) { return obj[k] }); function test(){ alert(array); } <-- index.html --> <!doctype html> <html> <head> <!-- css --> <!-- load bootstrap , add spacing --> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <style> body { padding-top:50px; } form { margin-bottom:50px; } </style> <!-- js --> <!-- lo...