我是Angular.js的新手,所以我知道这是一个太基本的问题,但这里看起来是唯一一个可以找到angular.js问题答案的地方。
<!doctype html>
<html ng-app="example">
<head>
<script src="angular.min.js"></script>
<script src="angular.sanitize.min.js"></script>
<script>
var example = 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>我关注罗德里戈·布拉纳斯(Angular.js Essentials)的书。他只是使用“停车”一词作为变量的名称,而不是“示例”。
我不知道是否有angular.js等的更新?
发布于 2014-11-04 19:03:20
要在$scope中显示项目,请使用:
<h1>{{ appTitle }}</h1>看看这把小提琴:http://jsfiddle.net/zn7osxt6/
https://stackoverflow.com/questions/26733356
复制相似问题