为什么我得到Lexerr:未结束的报价错误? [英] Why do I get Lexerr:unterminated quote error?

查看:320
本文介绍了为什么我得到Lexerr:未结束的报价错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的模板:

<!--Votez pour ce concept de bar:-->
<p ng-show="enabled('http://ballentines.herokuapp.com/{{finalist.slug}}.html') === 'novote'">Not voted</p>

<!-- Vous avez voté pour ce concept de bar-->
<p ng-show="enabled('http://ballentines.herokuapp.com/{{finalist.slug}}.html') === 'thisvote'">
    Voted for this concept
</p>

<!--Vous ne pouvez voter que pour un seul concept de bar -->
<p ng-show="enabled('http://ballentines.herokuapp.com/{{finalist.slug}}.html') === 'othervote'">
    Voted for another concept
</p>

当我尝试运行它,我得到

When I try to run it, I get

Error: [$parse:lexerr] Lexer Error: Unterminated quote at columns 8-57 ['http://ballentines.herokuapp.com/{{finalist.slug] in expression [enabled('http://ballentines.herokuapp.com/{{finalist.slug].
http://errors.angularjs.org/1.2.11/$parse/lexerr?p0=Unterminated%20quote&p1=s%208-57%20%5B'http%3A%2F%2Fballentines.herokuapp.com%2F%7B%7Bfinalist.slug%5D&p2=enabled('http%3A%2F%2Fballentines.herokuapp.com%2F%7B%7Bfinalist.slug

我在做什么错了?

What am I doing wrong?

推荐答案

NG-节目预计的前pression {{ }} 只是快捷方式 NG绑定指令。在你的情况

ng-show expects expression while {{ }} is just shortcut for ng-bind directive. In your case

<p ng-show="enabled('http://ballentines.herokuapp.com/' + 'finalist.slug + '.html') === 'novote'">Not voted</p>

应该工作。

这篇关于为什么我得到Lexerr:未结束的报价错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆