angularjs - Invoking $setValidity from jQuery -
I have a file uploader which I like for my UI which is written in jQuery. It is bound to my file element on a change action. The change action shows nifty previews and other cool stuff. It also checks to see if the mime-type is in the list of valid mime-types.
In addition to this, I have an angular JS wired and it is my form monitoring and I have written several instructions All of my assumptions I tried to write a verification for my file input field but for some reason Never removed Some goggling shows that due to this the angular file does not support the input type.
So I added the following code directly into my jQuery change action:
angular.element. (Scope). $ Apply (function (scope) {scope.project.avatar. $ SetValidity ('image', wrong);}); I can see that validity is set to the wrong in the debugger, but the action of the NG-class is not visible to me. So outside of this, I have the following tags:
That square is never added.
From fingers documents it appeared that $ was forced to refresh a model that was applied so that everything was back in sync. Obviously this is not happening, but I'm not sure what I am doing wrong. Googling found me a lot of examples of calling jQuery out of the glass, but little information about how to open angular within jQuery
Can you try with the following code
& Lt; Div ng-class = "{error: project.avatar.image}" & gt; You did it wrong & lt; / Div & gt; Here is the code of the verification , so the input type will be the $ error of the file type Image after verification will be true or false based on the set.
Comments
Post a Comment