html file at my front end and i need to inject it to my index.php div #container with angularjs injector and compile i'm little new with angular may somebody help ?
at first i tried to do it via ng-include like that
<div id="container" ng-include src="'<?= PATH_FRONT_END ?>main.html'"></div>
but i need by injector and compile something like this angular.injector(['ng']).invoke(['$compile', '$rootScope', function(compile, rootScope){ var scope = rootScope.$new(); scope.bar = "ok!";
var result = compile('<div>{{main.html}}</div>')(scope);
$("#foo").append(result.html());
}]);
but withe a link to my main.html
You need get the html using the $http service. You code should be something like this: