Created
August 29, 2013 05:54
-
-
Save allenyang79/6374646 to your computer and use it in GitHub Desktop.
angularjs ng-bind 測試
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app> | |
<div ng-controller="TextController"> | |
ex1:<br/> | |
{{someText}}<br/> | |
ex2:<br/> | |
<span ng-bind="someText"></span><br/> | |
ex3:<br/> | |
<span ng-bind-html-unsafe="someHtml"></span><br/> | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TextController($scope){ | |
$scope.someText = 'You have started your journey'; | |
$scope.someHtml='<span style="color:#f00">bala</span><a onclick="alert(\'Hello\');">bala</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment