Wednesday, 15 September 2010

php - Angularjs: how to Call method in Controller while submitting the Form -



php - Angularjs: how to Call method in Controller while submitting the Form -

actually in form page of angularjs, have 2 submit buttons i.e in 1 field set have 1 button update , button @ outside of field sets submission of whole page.

code

<form ....... data-ng-submit="register()"> <fieldset> ............ ............. <div data-ng-submit="update()"> <button type="submit" class="btn btn-success">update vehicle</button> </div> </fieldset> <fieldset> .........</fieldset> </form>

after submission of form ctrl

.ctrl(function(){ **we have 2 methods in it.......** $scope.update=function(){ } $scope.register=function(){ } }

while updating fieldset goes register method , executes logic in it.

how format data-ng-submit="update()", such phone call update() method in controller

php angularjs angularjs-directive angularjs-scope angularjs-ng-repeat

No comments:

Post a Comment