supman
V2EX  ›  问与答

angular 两种 click 事件 ng-click 和(click)有什么区别吗?

  •  
  •   supman · Oct 27, 2017 · 5675 views
    This topic created in 3185 days ago, the information mentioned may be changed or developed.

    <button ng-click="onClick()"></button>

    <button (click)='onClick()'></button>

    1 replies    2017-10-27 13:39:00 +08:00
    CFO
        1
    CFO  
       Oct 27, 2017 via Android
    第一个是 angularjs1 的写法 第二个是 angular2 开始用的写法
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1002 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: d3e9c8b8 · 44ms · UTC 22:52 · PVG 06:52 · LAX 15:52 · JFK 18:52
    ♥ Do have faith in what you're doing.