Dart and third party CSS and JS frameworks - javascript

I am gearing up to create my first web application and I've been reading a lot about Google Dart. It looks like a very fun, exciting new approach to web development and I am strongly considering using it for my application.
There is one question that I've been unable to find a solid answer for, however: is it possible to use a CSS/JS framework with Dart? In this case, I'm interested in using Twitter Bootstrap. I'd like to take advantage of the fantastic layout tools, buttons, and javascript modules it provides.
Would it be possible to use Dart and Bootstrap at the same time?
Do I even need to use Bootstrap? Does Dart already provide or make it easy to create what Bootstrap provides?

Thanks for your question. Yes, you can use Bootstrap with a Dart app. Bootstrap is mostly a set of CSS presets, patterns, and styles. There are a few JavaScript powered Bootstrap plugins for more interactive behavior. Depending on what you want to do, those JavaScript plugins can operate independently of your Dart app.
Dart does not bundle anything like Bootstrap. You could use Dart to replicate the Bootstrap plugins, but there isn't much need to do that.

I created small sample. Use bootstrap into Dart.
https://github.com/ehr174/dartstrap

You might consider Bootjack -- a Bootstrap port in Dart.

Related

Ionic3 import external web hosted javascript library

I am trying to create a iOS/Android app based on a client side html5 web project, (i.e. a site) I did.
I thought Ionic would be the ideal choice, that it would help me to port my web application as soon as possible.
In my site, I would use the 'script src="https:// ..."' tag to load the external lib, then calling it in another script
tag. However, I can't import and use it in Ionic3.
I tried many solutions tagged with 'ionic2' and nothing really seems to work.
It also seems no one knows a general solution for this, since each answer was case-specific.
Does anyone know a general way of importing external js file and using its objects and 'classes' in ionic3?
(I would prefer to load from the web, but I am also accepting to download and load it fro file. )
(If ionic isn't the best way of accomplishing my objective, I am open to suggestions)
I think you need to wait till release the Ionic 4 and Stencil.
What is all about Ionic 4 and Stencil?
The magical, reusable web component generator.
Stencil is a tool for building modern Web Components
Stencil combines some of the best features from traditional
frameworks, but outputs 100% standards-compliant Custom Elements, part
of the Web Component spec.
Stencil was created by the Ionic Framework team to build faster, more
powerful mobile and web apps. Stencil is the foundation for the next
generation of Ionic Framework, but is completely independent of Ionic
or any other UI framework.
Here you can see the official doc.
Nice video about the power of Ionic 4
Nice article about it
First of all have a look at this useful ionic resource, it explains how to add thirs party libraries using npm.
If you cannot use npm because of whatever reason you have to put the source .js file into your assets/js folder and import it in your index.html using a <script> tag. Then you have to tell typescript that your library exists. This is done like so: declar var <library-handle>. Where <library-handle> can be an exported function/class if the library already uses ES2015 or the object which exposes the functions using prototype. This is the tricky part where you may have to try a few things until you get it to work.
You can have a look at my answers here, here and here where I explained how to add different third party libraries to ionic projects.

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.

Using jQuery widget in Dojo

My web app mainly uses Dojo and I'm trying to implement jQuery's select2 (https://select2.github.io/). I read this and I know that it's possible to mix the two together but in my case, everything's built on top of Dojo and it's already a rather large web app. So is it still possible to implement a single jQuery widget into my Dojo based web app?
If not, would I have to go through the source code for select2 and convert into Dojo form?
I don't see why it wouldn't work. As long as there aren't any conflicts, you can use other libraries in conjunction with dojo. Now it may not be built with the AMD like everything else in dojo but it will still work fine.

Can jQuery be used with Ext.js?

After reading some of the jQuery vs ext js questions here and google search result, my understanding is that ext js is a UI building library and jQuery is a more fundamental javascript framework. I've used jQuery for a while now. It's pretty cool but in general a better (much better) javascript.
So my question is: how easy is it to use jQuery for DOM navigation/manipulation and Ext.js for UI in the same project?
There is a page on jQuery website. But the demo is too simple and the external links to Ext.js are all dead.
I'm sure it's possible, but what sort of problems and challenges would I be facing?
You might be wondering why I want to do this. Well, the Ext.js set of UI just looks much better/more polished/more feature rich then jQuery UI. I'm particularly interested in the grid.
Thanks!
Using both libraries side by side is not an issue in the technical way (just add the jquery within a script-tag, that's it!). However, you should not use jQuery for ExtJS' stuff or vice versa. Well, unless you know exactly what you do.
The actual issue can be DOM manipulations (jQuery or ExtJS Core) outside of an ExtJS component that affect an existing component.
So, in a nutshell: You can use DOM manipulations when it will not affect the ExtJS components. Otherwise use the proper way within the component itself.
Well you dont need both the libraries to live together.. Extjs has DOM manipulation api too probably not as vast as jquery but it does have the basic stuff.
Coming to Jquery, jquery has UI building APIs too if not rolled into the library there are vast no of extensions for all kinds of problems. Just try googling whatever UI you are building now with respect to jquery and you will find a library for sure.. There is jquery templates too that lets you generate HTML markup from a template defined by you and applying data objects (json) to it.. Jquery has a vast community too so most of your questios or concerns will be addressed by the community almost instantly..
So yea my suggestion would be to choose one library and stick to it and contribute to the library if there are many missing features..
Lastly I would suggest you choose Jquery.. It rocks.. period..
I think you would have no problem do this stuff... Make Ext.js your main jQuery library and jQuery as the data manipulation library for the DOM.
There would be no problem or conflicts because jQuery is compatible with other javascript libraries.

Categories