AlanZhang
V2EX  ›  Angular

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

  •  
  •   AlanZhang · Dec 12, 2014 · 10811 views
    This topic created in 4347 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
    L42y
    Dec 12, 2014❤️1
    1
    用 `ngRepeat`: https://docs.angularjs.org/api/ng/directive/ngInit

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