Hi,
I am not able to call $(jQuery) method to update css.
My project is into Ionic 2 Angular 2 and Typescript.
We have many reusable code written in Jquery which we want to access.
Example I am passing Userindex value to increase and decrease width dynamically.
But $ this one is giving error.
You don’t need jQuery to update your DOM elements.
I use a progress bar in my file transfer upload example. See the html and typescript to see how I update the progress. If you want a more detailed example I’d like to see some code (your html and typescript) to get me started.
If you really insist on using jQuery; without knowing the error you have gotten it is highly likely that you forgot to import jQuery in your typescript file.
what kind of stuff() we able to do in jquery>inonic2 ?
for example :
jQuery(this.vidi.nativeElement).on( “click”, function() {
console.log(‘sdfsdgertr’); // this works
this.dolog(‘test’); // this dialog show function doesn’t work
});
Ah, I think you’ll find the problem is the way jQuery handles this. Inside a handler, jQuery assigns this to the matched element, so in your case, this refers to this.vidi.nativeElement, not the class.
Something like this might work, although I haven’t tested it: