gpt4 book ai didi

javascript - 如何修复我的指令标记中的表达式结束错误?

转载 作者:行者123 更新时间:2023-11-28 00:08:17 27 4
gpt4 key购买 nike

Error: $parse:ueoe Unexpected End of Expression

看看 Chrome,这是我在控制台中看到的内容: <div ng-class="{" green-up":="" tgh.tag.direction="=" "positive",="" "red-down":="" "negative",="" ""="" :="" "stagnant"}"="">

enter image description here

这里是 the Gist 的链接以便于阅读。

template : 
'<div class="tags-hover-container" ng-show="tgh.tag.tagsHoverDisplay"> ' +
'<div class="tag-info-padding"> ' +
'<div class="tweets-direction" ng-hide="!tgh.tag.quantity"> ' +
'<div ng-hide="tgh.tag.length"> ' +
'<div ng-class="{"green-up": tgh.tag.direction == "positive", ' +
'"red-down": tgh.tag.direction == "negative", ' +
'"" : tgh.tag.direction == "stagnant"}"> ' +
'</div> ' +
'<div class="tweet-percentage">{{tgh.tag.tweet_percentage}}%</div> ' +
'</div> ' +
'<div class="tweet-count">{{tgh.tag.quantity}} tweets</div> ' +
'</div> ' +
'<div class="tweets-direction" ng-show="!tgh.tag.quantity">0 tweets</div> ' +
'<div class="associated-tags"> ' +
'<ul> ' +
'<li ng-repeat="ticker in tgh.tag.tickers"> ' +
'<div class="ticker" ng-click="tgh.selectTicker(ticker)">{{ticker}}</div> ' +
'</li> ' +
'</ul> ' +
'</div> ' +
'</div> ' +
'<div class="trending-tags-container"> ' +
'<div class="trending-tags" title="trending tags"> ' +
'<ul><li ng-repeat="trend in tgh.tag.momentum_twitter_preview">{{trend}}</li></ul> ' +
'</div> ' +
'</div> ' +
'<div class="tag-actions"> ' +
'<div class="tag-action-padding"> ' +
'<div class="hide-tag" title="Coming soon"> ' +
'<div class="close-x-sml"></div>Hide Tag ' +
'</div> ' +
'<div class="add-my-watchlist" ' +
'ng-hide="tgh.tag.favorite == 1 || faved" ' +
'ng-click="tgh.addFavorite(tag)" title="Add to Favorites"> ' +
'+ My Favorites ' +
'</div> ' +
'<div class="add-my-watchlist" ' +
'ng-show="tgh.tag.favorite == 1 || faved" ' +
'ng-click="tgh.removeFavorite(tag)" title="Remove from Favorites"> ' +
'- My Favorites ' +
'</div> ' +
'</div> ' +
'</div> ' +
'<div class="tags-hover-bg"></div> ' +
'</div>',
restrict: "E",

最佳答案

此处的标记无效:

<div ng-class="{"green-up": tgh.tag.direction == "positive", ' + ...

您应该使用 \ 对双引号内的双引号进行转义或使用单引号。

关于javascript - 如何修复我的指令标记中的表达式结束错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31147789/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com