I am trying to create a chrome extension that modifies the content a specific website. Since I do not have access to the src code of the website i have to change it through javascript
I want the new content to be dynamic and updates through angular (the original website does not use angular).
i am injecting a tag with ng-app and ng-controller and create an angular app and controller in js.
However the page does not understand the angular html directives and render it verbatim.
What am i doing wrong?
from the tutorial code : i am injecting this to the html (using js code that's injected by chrome extension, on page load):
<div ng-app="phonecatApp" ng-controller="PhoneListCtrl">
<ul>
<li ng-repeat="phone in phones">
<span>{{phone.name}}</span>
<p>{{phone.snippet}}</p>
</li>
</ul>
</div>
and this to the js (injected through extension, on page load):
var phonecatApp = angular.module('phonecatApp', []);
phonecatApp.controller('PhoneListCtrl', function ($scope) {
$scope.phones = [
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.'},
{'name': 'Motorola XOOM™ with Wi-Fi',
'snippet': 'The Next, Next Generation tablet.'},
{'name': 'MOTOROLA XOOM™',
'snippet': 'The Next, Next Generation tablet.'}
];
});
which is run after page load