Ember Octane and JQuery - javascript

For the past few weeks i've been playing with ember octane which in my opinion is awesome.
I've tried a few ember plugins in order to test which plugins are working currently with ember octane, some of them require jQuery to work.
So my question is: if it's possible to add jQuery to ember octane to make those plugins work?

Haven't tested it myself but it should be as easy as:
Add #ember/jquery package as a dev dependency.
Enable optional feature jquery-integration.
An optional feature could be enabled using Ember CLI by running ember feature:enable some-feature or by editing config/optional-features.json manually. You could find more information about optional features in Guides.

One thing to note from #jelhan's answer is that adding #ember/jquery will only allow you to use JQuery internally. It will not allow Ember addons to use JQuery. For the ember addons to use JQuery, you would need to request that the addon add #ember/jquery to their dependencies.

Related

Conflicting versions of dependencies in JavaScript/AngularJS

My earlier question was closed before I had the chance to add more clarity to it.
Might be a very basic question, but if I am using a particular version of a dependency, for example 1.x of dependency1, in my angular directive, and I package this directive to be used as a third party directive in an app that uses version 2.x of the same dependency1, how will the behavior be? I want to understand how shared directives work with multiple apps that might use a different version of a dependency that the directive is using.
I should probably make myself clear that I’m not asking about versions of angular. Let’s say I’m using bootstrap v3.3.7 in my directive whereas another app that uses my directive is using v3.1.1 of bootstrap. I want to understand how this would work and if there would be any conflicts.

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.

What is angular2-mdl, where can i find it, what did it provide?

What is angular2-mdl?
Why does angular2-mdl exist?
Where can I find the sources?
Where can I find a demo?
Is it installable by npm?
angular2-mdl are angular 2 components, directives and styles based on material design lite (http://getmdl.io). It is available as npm package npm install angular2-mdl. The sources are available on github (https://github.com/mseemann/angular2-mdl) All components are documented here: http://mseemann.io/angular2-mdl.
It exists because:
It allows you to write short html templates to get a material design lite look and feel.
It integrates the components with the latest version of angular2 (2.0 Final).
It make two way binding and reactive forms available.
It is themeable by switching the styles from mdl or by using the original scss.i
It uses the well tested and widely used original css from getmdl.
It is dynamic. You can create and destroy components during the lifetime of your app and the ui is going to change as expected. There is no need to hack around with the mdl javascript.

How to add a datepicker to angular-meteor?

I've just started experimenting with angular-meteor, which feels good, but weird at the same time. The thing I'm uncomfortable with is the fact that everything is done with packages and that I'm unsure of how much I can do manually.
So I've followed the tutorial up until step 9 which made a simple party planning website. I now want to add a datepicker so that parties also have dates. For this I want to use something like Bootstrap Datepicker or angular-datepicker or this Meteor Datepicker but I'm unsure of which one to pick and how to do this.
Do I need to install everything in meteor using meteor packages? Should I use bower? Can I manually inject those libs using the regular <script src=""> way? And which one would be the most appropriate?
All tips are welcome!
Since the impact of this feature is restricted to the presentation layer, how you choose to install / integrate your datepicker is mostly a matter of taste.
You can go for a meteor package, and get simpler integration (given that the package has no conflicting dependencies with your project, such as iron-router vs flow router) and updates (given that the package is seriously managed and maintained)
If you choose to go with bower or another package manager than meteor's (or none and just download the sources, for that matter), you'll need to integrate the library yourself (either through a custom package or directly in the client/lib folder) and update it manually. But you will get "official" updates from the actual library maintainers.
To keep things simple, I would personnaly go with rajit:bootstrap3-datepicker. It seems correctly maintained (last commit a couple months ago), and has enough installs for my taste:
$ meteor add rajit:bootstrap3-datepicker
Then in my template:
<label>Date</label>
<input type="text" class="form-control" id="my-datepicker" ng-model="newParty.date">
And in PartiesListCtrl I would set up the datepicker using:
$('#my-datepicker').datepicker();
If you consider doing the integration yourself after all, here are a couple useful SO links for you: here and here and here

Using multiple versions of RequireJS

I have a web app built with Dojo 1.7.2, using RequireJS to load individual modules with AMD. I'd like to add a slightly customized copy of the ACE code editor version 0.2.0, which is about 9 months old and uses an earlier, incompatible version of RequireJS to load itself.
Really I'd just like to include the different JavaScript files (Dojo and ACE) without having a namespace collision (on global functions declare and require which is something that RequireJS is designed to help prevent anyway). I'd like to do this without further customization of either project. Is that even possible to do?
Ace's authors recommend using the newest version from the master branch which should be compatible with recent RequireJS.
BTW, could you post somewhere how you managed to run Dojo 1.7.2 with RequireJS?

Categories

Resources