AngularJs - element.on('submit') is not working in my directive -


I am trying to use an NG-deposit call to fire an event for my custom instruction, But it is not firing.

Here is a problem that describes my problem.

  & lt; Div ng-controller = "MyCtrl" & gt; & Lt; Form name = "loginForm" ng-submit = "login ()" novalidate = "" & gt; & Lt; Input type = "submit" class = 'please-wait' value = "submit me" /> & Lt; / Form & gt; & Lt; / Div & gt;   

JS code:

  app.directive ('please wait', function () {return {restricted: "c", compiled: function (element } {Element.on ('submit', function (e) {alert ('submit');}) element.on ('click', function (e) {alert ('click called');}); ;});   

What am I doing?

"submit" There is no event on a input element, but There is an incident on form , so the instruction is listening for the event that it will not be received.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -