What is the difference between the $parse, $interpolate and $compile services?
问题 What is the difference between $parse , $interpolate and $compile services? For me they all do the same thing: take template and compile it to template-function. 回答1: Those are all examples of services that aid in AngularJS view rendering (although $parse and $interpolate could be used outside of this domain). To illustrate what is the role of each service let's take example of this piece of HTML: var imgHtml = '<img ng-src="/path/{{name}}.{{extension}}">' and values on the scope: $scope.name