Saturday, 15 May 2010

javascript - Calling AngularJS function inside jQuery -


I am calling an AngularJS function inside a jQuery function, but the execution is not sequential. When I execute this page, jQuery warns before warning AngularJS instead of warning. How can I confirm that the AngualarJS function is executed? After performing the AngularJS function, it should execute the next line on jQuery.

Javascript function: -

  (function ($) {$ .fn.multipleInput = function () {Return this.each (function () {angular.element ( '# TheController'). Scope.getFullName ($ input.val ()); Warning ("ANGULAR JS");}});  

Angulose Function: -

bipin.controller ('Controller', ['$ Scope', '$ q', '' '$ Http', '$ window', function ($ radius, $ q, $ http, $ window) {$ scope.selected = ''; $ scope.email = ''; $ Scope.fullName = ''; $ Scope.getFullName = function (item) {warning (); return $ http.get ('https: // myservice / v1 / query /' + $ label). Then (function (response) {return response.data.items. Map (Function (item) {warning ("INSDE ANGULAR JS"); $ scope.fullName = item.fullName; come back m.fullName;});});}; $ http.get asynchronous , Because

When you say it, it gives a promise and jquery function The execution continues. When the .then function is executed from http call server and when the alert is displayed in it, but as Tony Barnes said, I think you can apply it to a pure angle. There is no need to mix two.


No comments:

Post a Comment