开发备忘:AngularJS Syntax error, unrecognized expression in template file

在写基于Angular的项目过程中,运行 grunt test的时候,一直给我蹦出这个错误,导致我的test一直跑不过,怎么试都是失败,经过重复排查,发现是因为template file中的html元素前面有个空格导致的。

 <div class="testbar" ng-click="playTextAudio()"></div>

我把那个空格用红色标注了,只要去掉就正常了。希望大家以后遇到这个问题小心应对。

原文地址:https://www.cnblogs.com/scy251147/p/5028969.html