javascript - ngBindHtml doesn't work with ngSanitize -
i'm newbie on angular.js know basic question here looks place find answers angular.js questions.
<!doctype html> <html ng-app="example"> <head> <script src="angular.min.js"></script> <script src="angular.sanitize.min.js"></script> <script> var illustration = angular.module("example", ['ngsanitize']); example.controller("examplectrl", function($scope){ $scope.apptitle = "<b>example angular app</b>"; }); </script> </head> <body ng-controller="examplectrl"> <h1 ng-bind-html="apptitle"></h1> </body> </html>
i follow book of rodrigo branas(angular.js essentials). utilize "parking" word name of variable instead of "example".
i don't know if there update angular.js etc?
to display items in $scope utilize :
<h1>{{ apptitle }}</h1>
checkout fiddle: http://jsfiddle.net/zn7osxt6/
javascript angularjs
No comments:
Post a Comment