加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – Parser Error:得到插值({{}}),其中表达式是预期的

发布时间:2020-12-17 07:50:54 所属栏目:安全 来源:网络整理
导读:我使用ng-bootstrap替代angular2中的ui-bootstrap. 我的HTML如下: ul class="list-inline" li class="tag" ngb-dropdown auto-close="outsideClick" *ngFor="let item of ['Elastic Search','Database Theory','CVS']; let $index=index;" [ngClass]="{'def
我使用ng-bootstrap替代angular2中的ui-bootstrap.

我的HTML如下:

<ul class="list-inline">
    <li class="tag" ngb-dropdown auto-close="outsideClick" 
        *ngFor="let item of ['Elastic Search','Database Theory','CVS'];
        let $index=index;" 
        [ngClass]="{'default-tag': $index==0,'matched-tag': $index==1,'unmatched-tag': $index==2 }">
         <a href ngb-dropdown-toggle id="desiredSkill{{$index}}">
             <i class="bi_interface-tick following"></i> {{item}} <i class="bi_interface-more tag-menu-icon"></i>
                            </a>
               <ul class="dropdown-menu tag-menu" ngb-dropdown-menu [aria-labelledby]="desiredSkill{{$index}}">
                     <li><a href>Follow Skill</a></li>
                     <li><a href>Related Jobs</a></li>
                </ul>
     </li>
  </ul>

但是当我运行我的应用程序时,我得到以下错误:

main.browser.ts:25Error: Template parse errors:
Parser Error: Got interpolation ({{}}) where expression was expected at column 12 in [desiredSkill{{$index}}] in
JobDescription@174:77 (”
][aria-labelledby]=”desiredSkill{{$index}}”>

  • “): JobDescription@174:77
    Parser Error: Unexpected token ‘{‘ at column 13 in [desiredSkill{{$index}}] in JobDescription@174:77 (“

    ][aria-labelledby]=”desiredSkill{{$index}}”>

  • “): JobDescription@174:77
    Can’t bind to ‘aria-labelledby’ since it isn’t a known property of ‘ul’. (”
    ][aria-labelledby]=”desiredSkill{{$index}}”>
  • “): JobDescription@174:77
    Parser Error: Got interpolation ({{}}) where expression was expected at column 12 in [desiredSkill{{$index}}] in
    JobDescription@174:77 (”

    06001

    JobDescription@215:49
    Parser Error: Unexpected token ‘{‘ at column 13 in [desiredSkill{{$index}}] in JobDescription@174:77 (“

    06001

    JobDescription@215:49
    Parser Error: Got interpolation ({{}}) where expression was expected at column 12 in [desiredSkill{{$index}}] in
    JobDescription@174:77 (”
    ERROR ->=”main.applyJob()”>Apply for job

    ERROR ->=”main.applyJob()”>Apply for job

    ][hidden]=”!ifNotApplied”>Applied

    ][hidden]=”!ifNotApplied”>Applied

    ][hidden]=”!ifNotUploaded”>Upload CV

    ][hidden]=”!ifNotUploaded”>Upload CV

    Have questions about this job?

    [ERROR ->]

    Have questions about this job?
    [ERROR ->]

  • 您不能在标准属性绑定中使用插值.应该有表达.

    似乎它应该是:

    [attr.aria-labelledby]="'desiredSkill' + $index"

    要么

    attr.aria-labelledby="desiredSkill{{$index}}"

    (编辑:李大同)

    【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

      推荐文章
        热点阅读