0

I have this code like this:

$scope.role.object_access_right = {contact:1,group:1,image:1,text:1,email_template:1,email:1,channel:1,campaign:1,invoice:1,user:1,account:1,tenant:1,}

I have empty array here,

$scope.access = [];

How can I push the key to empty array to have result ?

 $scope.access = [contact,group,text ...]
0

1 Answer 1

6
$scope.access = Object.keys($scope.role.object_access_right);

That should do the trick.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks and more question,I want to get value and use: $scope.access = Object.values($scope.role.object_access_right); but it not work for me ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.