ng-bind-template指令可以用于制定數(shù)據(jù)綁定模版朴恳,下面的例子綁定兩個(gè)分離數(shù)據(jù)的
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="mCtrl">
<p ng-bind-template="{{firstName}} {{lastName}}"></p>
</div>
<script>
var app = angular.module("myApp",[]);
app.controller("mCtrl",function($scope){
$scope.firstName = "hello";
$scope.lastName = "world";
});
</script>
輸出結(jié)果:hello world
注:hello與world是分離的
問(wèn)題記錄:我發(fā)現(xiàn)有些版本的angularjs并不能直接使用這個(gè)指令羔挡,原因找尋中坎缭。