Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AngularJS模板的奇怪问题_Angularjs - Fatal编程技术网

AngularJS模板的奇怪问题

AngularJS模板的奇怪问题,angularjs,Angularjs,我在Angularjs中遇到了一个非常奇怪的问题,我使用了一个指令,在页面上定义了一个内联模板,如下所示: <script type="text/ng-template" id="breadcrumb.html"> {[ state.current.displayName ]} </script> <script type="text/ng-template" id="breadcrumb.html"> a{[ state.current.displayNa

我在Angularjs中遇到了一个非常奇怪的问题,我使用了一个指令,在页面上定义了一个内联模板,如下所示:

<script type="text/ng-template" id="breadcrumb.html"> {[ state.current.displayName ]} </script>
<script type="text/ng-template" id="breadcrumb.html"> a{[ state.current.displayName ]} </script>
这还不够吗。如果这不起作用,为什么在上面加上一个随机字符“a”会有帮助呢

编辑2:

普朗克补充说:

请检查此链接以了解工作代码:

请检查此链接以获取非工作代码:


对于插值,
{{}

为避免冲突,您可以使用
ng bind

<script type="text/ng-template" id="breadcrumb.html" ng-bind="state.current.displayName"></script>


但是,我从未尝试过使用
标记。

这是Angular JS(1.2.x)当前版本的一个确认问题

我在这里提交了一张票:


0
{{}
。更新了我的问题,谢谢。你能提供plnkr或JSFIDLE吗?plnkr根据要求添加
angular.module('myapp', []).config(function($interpolateProvider){
        $interpolateProvider.startSymbol('{[').endSymbol(']}');
    }
);
<script type="text/ng-template" id="breadcrumb.html" ng-bind="state.current.displayName"></script>