I want to get $scope value so I can change the data values in it through chrome extension.. I have used the following code to get the $scope
var $scope = angular.element(document.getElementById('name')).scope()
It work fine when I try it on Console.but when I put the code in extension it gave me this error . angular is not defined So I also added angular.js file in my chrome js file . But still i could not get the $scope and does not able to change the data . This is the code I am using `
$scope = angular.element(document.getElementById('name')).scope();
console.log($scope);
$scope.$apply(function () {
$scope.data.contact_type = 20;
$scope.data.contact_name = $('#Contactname').val();
$scope.data.contact_company = $('#contactCompany').val();
$scope.data.contact_email = $('#contactEmail').val();
$scope.data.contact_phone = $('#contactPhone').val().replace('/', '-');
$scope.data.hide_contact_email = 1;
});`
Kindly anyone help me to get the $scope and change it in the extension as well .