supman
V2EX  ›  问与答

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

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