Enables binding angular expressions to onsubmit events.
Additionally it prevents the default action (which for form means sending the request to the server and reloading the current page).
<form ng:submit="expression"> ... </form>
expression – {expression} –
Expression to eval.
<form ng:submit="list.push(text);text='';" ng:init="list=[]"> Enter text and hit enter: <input type="text" name="text" value="hello"/> <input type="submit" id="submit" value="Submit" /> </form> <pre>list={{list}}</pre>
it('should check ng:submit', function(){ expect(binding('list')).toBe('list=[]'); element('.doc-example-live #submit').click(); expect(binding('list')).toBe('list=["hello"]'); });