V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
AlanZhang
V2EX  ›  Angular

ng-repeat 用了多个$index, 怎样定位不同的$index?

  •  
  •   AlanZhang · Dec 12, 2014 · 10321 views
    This topic created in 4154 days ago, the information mentioned may be changed or developed.
    ng-repeat="certification in product.certifications track by $index"
    ng-repeat="standards in certification.standards track by $index"

    这两个$index都需要定位到。
    3 replies    2014-12-12 11:13:54 +08:00
    L42y
        1
    L42y  
       Dec 12, 2014   ❤️ 1
    用 `ngRepeat`: https://docs.angularjs.org/api/ng/directive/ngInit

    The only appropriate use of ngInit is for aliasing special properties of ngRepeat
    L42y
        2
    L42y  
       Dec 12, 2014   ❤️ 1
    不好意思,应该是用 ngInit
    AlanZhang
        3
    AlanZhang  
    OP
       Dec 12, 2014
    非常感谢。 就是这个。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4812 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 01:05 · PVG 09:05 · LAX 18:05 · JFK 21:05
    ♥ Do have faith in what you're doing.