supman
V2EX  ›  问与答

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

  •  
  •   supman · Oct 27, 2017 · 5867 views
    This topic created in 3264 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   ·   Privacy   ·   Solana   ·   2255 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:20 · PVG 18:20 · LAX 03:20 · JFK 06:20
    ♥ Do have faith in what you're doing.