AngularJS2: Include JQuery into application - javascript

after a good hour of googling I still haven't found out how to properly include JQuery (or any normal JS file for that matter) into my AnuglarJS application, how would I go over this?

AngularJS provides jqLite, which is a jQuery-like library that provides a subset of jQuery functionality.But it doesnt work if you include jQuery in your app. You should check this out for how to integrating angular and jQuery
http://www.bennadel.com/blog/2752-using-jquery-instead-of-jqlite-in-angularjs.htm

Related

How can I force old, compiled jquery plugins to use a specific version of jQuery in WordPress?

I have a client who had a very complex jQuery app custom built by a previous developer within his WordPress site. Its functionality is cleanly broken out into several scripts which get minified together with the libraries they depend on. The libraries rely on an old version of jQuery (3.3.1). The site is complex and we need to be able to use the current version of jQuery to allow other plugins we're using to continue to keep up with upgrades.
The libraries include c. 2018 versions of:
Select2
Isotope
SpriteSpin
EasyResponsiveTabs
ImagesUploaded
jQuery Viewport
Some of these are minified/uglified.
I've used best practices to load jQuery 3.3.1 into a variable jQuery3_3_1 with noconflict();
It's rather easy to change standard jQuery to use jQuery3_3_1. But I need a way to force the libraries to use jQuery3_3_1, otherwise they are not recognized by the scripts (and some of them will have issues using a different version of jQuery than they were built in). Most of these use requireJs(), and I've seen instructions for setting up requirejs.config() code in the footer that will define "jquery" to be a particular version. Doing this would be a great solution, but I have no idea how to get these uglified scripts to use it.
I've read through several similar inquiries, but none have addressed forcing a jQuery version on minified/uglified code. Others speak to a level of expertise in jQuery module development that I don't have and don't have time to scale into.
Is there a way to get all these modules that use require('jquery') to have that reference jQuery3_3_1? I'd love it if there were a way to say, "For all the files that live in this directory, jQuery/jquery (there are 2 ways it is called) means jQuery3_3_1/jquery3.3.1".
Or being that it's a Wordpress site, could this be defined in the wp_enqueue_script() call?
Many thanks for your help!

How to upgrade angularjs with jquery to angular 9?

I have a project in angularjs and I want to upgrade this project to Angular9.
The problem is most of the project uses jQuery features such as query-ui, selectors, change the dom, animations, bootstrap and more.
Say it may only my problem since I do not want to use jQuery after the upgrade, just to do stuff in the angular way. so I guess to convert jQuery to angular.
I wonder if there is a way to do that? or I need to go manually and remove the jQuery code to new one?
I know I can import jQuery to my project, but sometimes I use $('#some').innerHtml('bla') and this is not what I want to do in my new code.
What are the ideas or approaches should I consider and use?

How to use both older version and latest version of jquery in a website along with third party plugins?

I am working on an application where the jquery library(currently refrenced ver is 1.4.4) was never updated and the application is very big with lot of usage of jquery spread accross different pages.
I cannot upgrade the jquery library to latest version as this will break the entire website.
Now I have a problem to use third party plugins like datatable, bootstrap js, etc.
I know we can use jquery.noConflict() and give an alias to the latest jquery library and start using that.
But I am not sure if the third party plugins will also work as I think they all are using $ in their code and if I use the above solution my $ will be pointing to older version of the jquery file.
Please help me with your suggestions in this scenario.
Thanks in advance.

Has jQuery Template no conditionals?

I'm watching a course (2014) about jQuery Template.
One sentence troubled me:
from text
The nice thing about jQuery Template is that it's a plug in for
jQuery. And it leverages existing jQuery syntax. And many websites
already use jQuery. So chances are, you're already familiar with how
to load and use this particular plugin. It's used for simple
templating. There are no conditionals or logic in jQuery Template.
But jQuery Template has {{if}}, {{else}}. So jQuery Template has conditionals. Am I right?)
Or don't I misunderstand author? Or is it serious author mistake?
I try to find documentation
jquery-template - is it old version? I didn't find if statements
jquery-tmpl - Is it new version? readme.md describes
{each}}, {{if}}, {{else}}, {{html}}, {{tmpl}} and {{wrap}}
For context on jQuery Templates, see the info on the jquery-templates tag: https://stackoverflow.com/tags/jquery-templates/info.
You will see that the original official jQuery templates is this one jquery-tmpl. It does support conditionals. The ongoing next-generation version of jQuery templates is jsrender - which actually has better separation of code, markup and logic, (and better separation from the DOM) - and provides more powerful logic support than jQuery Templates did.
The other link you give, to jquery-template is a completely different templating approach, that recently chose to use 'jquery-templates' for its github project name, although it is in fact quite unrelated to the official (and much used) jQuery Templates.

Dojo PJAX library

Just like jquery-pjax for jQuery users, is there support for the same in Dojo (for folks using Dojo 1.7.x)?
Not sure if this is helpful or not (as its not truly a dojo implementation of PJAX), but you should be able to use PJAX-Standalone https://github.com/thybag/PJAX-Standalone along side dojo without any issue's (basically pjax without the JQuery dependencies).

Categories

Resources