给定
<li>Document Printing -
<a href="http://{{displaySandbox()}}/{{displayCase()}}/PrintingService/DocumentPrintingService.svc">
<span ng-class="{true:'value',false:'invalid'}[(sandbox && validcase())==true]">http://<span class="sandbox">{{displaySandbox()}}</span>.companyname.com/<span class="case">{{displayCase()}}</span>/PrintingService/DocumentPrintingService.svc</span></a>
<span ng-bind-html-unsafe="getUrl('/PrintingService/DocumentPrintingService.svc')">
</span>
</li>
我想声明一些类似的东西
<div ng-var="subPath=/PrintingService/PrintingService.svc>
这样该范围内的任何内容都可以说
<li>Document Printing -
<a href="http://{{displaySandbox()}}/{{displayCase()}}{{subPath}}">
<span ng-class="{true:'value',false:'invalid'}[(sandbox && validcase())==true]">http://<span class="sandbox">{{displaySandbox()}}</span>.companyname.com/<span class="case">{{displayCase()}}</span>{{subPath}}</span></a>
<span ng-bind-html-unsafe="getUrl(subPath)">
</span>
</li>
angular.js
有没有办法通过在 html中声明一个范围(如果你愿意,可以是一个变量或“常量”) ?