Angular2 JQuery Plugin Integration - javascript

Though this question asked quite a few times, there is no clear answers. I am beginner in Angular2. Please correct me if I am wrong. Is it wise to integrate JQuery plugins with Angular2. Imagine a JQuery plugin like JQuery UI with no proper typings available. How to implement that in Angular 2. What are the problems of using JQuery with Angular2. This question is already asked but answer is not useful.

It's clear and obvious that jQuery and
Angular are two different frameworks written above JavaScript. So it
is not recommended to use both the frameworks at same time on a single
project (either use jQuery or use Angular).
There are UI components available that are re-written using Angular without the dependency of jQuery. You can check ng-bootstrap and ngx-bootstrap which have almost all Bootstrap components written completely with Angular.
Alternatively, there is another complete UI framework for Angular based on Google's Material Design specs named Angular Material. Currently Angular Material for Angular 2 is in beta.
Also there are bundle of official UI resources that you can use and drive smoothly with Angular.

Related

using angular 5 for new project

I am using angular 5 for my new project. and as it is said that jQuery is not recommended for angular-5, i am using ng-bootstrap which do not require 3rd party libraries. I am also using angular-material. I have following problems faced.
There is No documentation for table in ng-bootstrap.
If i use angular material, for tabs there are no more options for customising tabs the way i want. Only restricted options are available.
If i use both ng-bootstrap and angular-material, i feel unecessarily complexity will be increased.
if i use any one of them 1st and 2nd problem will not be solved.
i don't have proper documentation for problems i am facing.
Based on my own experience:
Angular-material is not mature enough for a serious project. Go with ng-bootstrap (not native bootstrap), and in case you need to work with tables, go with an additional table lib for angular like https://github.com/swimlane/ngx-datatable

is angularjs still frowned upon to build widgets that installs on 3rd party websites when compared to jquery?

I read a stackoverflow post stating that using jquery to build a widget is better than angularjs. Their reasoning was because angularjs widget might interfere with the angularjs installed on the websites browser.
Link to the post: How to use AngularJS to build javascript widgets for public use?
It was posted in 2013, so I'm not sure if angularjs was updated to fix this issue.
If the applications are all using Angular then Angular widgets are the best asbthey give you more power and tie into the framework itaelf naturally.
If you are talking about general widgets then you want as few dependencies as possible. If you create a an Angular widget is will not be usable without Angular and people using other frameworks will not accept pulling in Angular to use your widget.

Bootstrap framework without jquery

I have requirement to develop a front end project. I am planning to use angular + bootstrap. I don't have to use jquery, but bootstrap javascript components require jquery. my question is,
1)Can we have bootstrap built on javacript.
2)Can we have bootstrap built on angular.
please provide related good documents on any above two related topics.
For angular project you can user UI Bootstrap which have bootstrap CSS file with a set of native AngularJS directives.It does not require jQuery or Bootstrap's Javascript.The only required dependencies are:
AngularJS
Angular-animate
Bootstrap CSS
Check it here
Have no worry, the internet is full of scripts and tutorials, native JavaScript is the coolest programing language ever! Far more powerful and requires almost zero maintenance on very long periods of time.
Also some features are even better.
If you are looking for Bootstrap without jQuery or vanilla Javascript for Bootstrap, you can use bootstrap.native
The Bootstrap plugins are jQuery plugins, so no, strictly speaking, you can't use them without jQuery. There is this project, however, which may help you.
When building out Angular projects, you should not add on the full jQuery library. jQlite is already included in Angular and this should be all the jQuery that is necessary.
Reference

Adding AngularJs to a Bootstrap Theme

I am using a certain Bootstrap Theme purchased from ThemeForest for building a Web Application Project.
To be specific the theme referred to is - http://themeforest.net/item/modern-responsive-admin-dashboard-template/11004840
I have already completed the Frontend using that theme. Now when I start adding in the backend and integrating, I feel it might be more effective to use AngularJS than use Jquery to manipulate the DOM and the objects.
Can I just start using AngularJS for the dom manipulations in the same project? Or will I be facing any problems? I would like to check if there will be any conflicts arising out of me using both together ?
If there are any tutorials, please refer that to me. Thanks
Angular and bootstrap are 100% compatible. Just add the script tag for angular into your bootstrap project and you have a hybrid angular bootstrap project.
You will have no problems at all. If you're looking for examples of open source AngularJS projects which used Bootstrap, there are multitudes. Here's one of my own over on Github: https://github.com/JohnMunsch/PaperQuik
Note: In addition to being able to just use the two together, there's also projects like Angular Strap which provide Angular directives to wrap the various components (both JavaScript and not) provided by Bootstrap and make it easier to integrate them into your AngularJS code.

AngularJS and jQuery... What's wrong with using both?

I saw a few blog articles saying that AngularJS and jQuery could be used together in one app. That seems good as jQuery has some functionalities Angular doesn't have and Angular allows us to make a greatly structured logic for a web app.
The fact is, as I'm french I also take a look at french blog articles about that, and french tends to say that we should never use jQuery and Angular together. I asked why on a forum and people said that it's probably because beginners usually use jQuery and Angular for the same things : adding elements dynamically, use ajax requests, etc... But I'd like to use jQuery for some things Angular does not do and to allow bootstrap js to work on my app.
What do you think, are jQuery and Angular bad at working together in one single app? Or does it just depend on how we make them work together?
AngularJS uses JQuery itself, the major reason not to mix and match is just what you described of them stepping on each other's toes.
While I was learning Angular a lot of the time I would end up using JQuery alongside it because I didn't understand Angular or know it's full capabilities. After learning it better my code has continuously less JQuery in it, but if I can't figure it out in angular, I'll make sure it works with JQuery until I can get it.
I guess it depends on what you're aiming for. If you want to develop an Angular app, then Angular already includes a version of jQuery called jQlite, but you can still use jQuery in your Angular app if you want to.
You can actually "wrap" jQuery code into custom Angular directives, which is pretty sweet.
In an Angular app it's safe to include jQuery if you want to implement some Bootstrap functionality. Currently, I'm doing that to implement Bootstrap's collapse component. I have only just begun developing in Angular, so I am not an expert as to all the ins-and-outs of using jQuery with Angular.

Categories