I'm trying to understand dependency injection in AngularJS.
Right now, I'm trying to inject $interpolate and $eval into my controller, but reading the documentation didn't clarify because I don't have a good foundation on Angular.
Take the following code that demonstrates the issue I don't understand:
var module = angular.module('ngAppDemo',[ ]);
module.controller('ngAppDemoController', function($scope, $parse) {
$scope.a = 1;
$scope.b = 2;
$scope.myHTML = '{{a}}';
});
Can someone help me understand how to inject and $interpolate the myHTML string? Or if interpolation is not correct in evaluating that string, what is? It's a weird case, but I'm just trying to learn right now.