Can we use es6 with AngularJS - angularjs

I'm working on an angularJS website and i wanna know if we can code in es6 natively (we use babel now) since the web browsers support es6.
Thanks,
Marius
EDIT: i use AngularJS 1.5.8

Related

Does i18next work on cordova?

I am making an app with Angular 1.5.3 and I know that the i18next library works with Angular. https://www.i18next.com/supported-frameworks.html
However, does this still apply if my angular app will be run inside of Cordova?
I recommend you to use angular-translate which can be found at this link: Angular Translate . I used it with a lot of Ionic projects. Thats works like a charm

How to setup angularjs 1.5.x work with systemjs and typescript

I want to keep all my code still in 1.x and also want code is easy to upgrade to angularjs 2 latter. To make my code follow angular 2 style, I want to work with typescript and systemjs in 1.5.x firstly.
Does anyone have a work-around/code on how to setup angularjs 1.5.x work with systemjs and typescript?
This is the best match I found use babel as compiler: https://github.com/swimlane/angular1-systemjs-seed
But I want systemjs works together with typescript in angular 1.
There are some seed projects to get you started with angular and jspm (es6):
https://github.com/angularclass/NG6-starter/tree/jspm
https://github.com/davinkevin/angularjs-jspm-seed
This one is for jspm + typescript
https://github.com/b091/ts-skeleton/

Angular 2 syntax helpers for Angular 1.2

My application is in angular version 1.2. We are planning to make any new changes using typescript and angular 2 syntax helpers (like ng-metadata or angular2-now)
Unfortunately the above syntax helpers only works for angular version 1.4+. Is there any such helpers available for angular 1.2?
try this Angular-Typescript project on github, and my advice is to updated your project to 1.4 or above to make it easier for you!

Use AngularJS (Angular1) module from Angular2 project

Just started a demo Angular2 project (no previous experience with Angular1/AngularJS. Have followed and extended from the online quickstart and tutorials, and all was fine. However I'm at the point where I would like to use some components from a library which is designed for AngularJS, and having no end of problems!
Most of the information available about AngularJS/Angular2 compatibility assumes that you have an AngularJS project that you're adding Angular2 components to - not the other way around - so what I'm hoping to do may not even be possible. What I've tried so far involves a simple stripped-back project based on the Angular2 quickstart, with a single Angular2 component that loads into the index.html. I'd then like to integrate components from the existing library (AngularJS-based) into this.
I've tried using UpgradeAdapter.upgradeNg1Component to create components from the library and add them directly into my Angular2 component
I've tried installing angularjs through npm, importing it in a script tag into my index.html and then using a combination of UpgradeAdapter.downgradeNg2Component and UpgradeAdapter.bootstrap to load my Angular2 as a downgraded module
Neither of these seem to work - the component fails to show, and the browser console tells me I've got an Uncaught SyntaxError: Unexpected token <
Evaluating http://localhost:3000/angular2/upgrade
Error loading http://localhost:3000/app/main.js
My best guess at the moment is that this is actually an unsupported scenario, and I need to have a 'proper' AngularJS app in order to use the UpgradeAdapter functionality from Angular2. Can anyone confirm this? Or is there something stupid I'm missing here?
Here is a working plunkr describing how to mix Angular1 and Angular2 elements:
http://plnkr.co/edit/yMjghOFhFWuY8G1fVIEg?p=preview
An important point is to bootstrap your main component on the UpgradeAdapter. This way all elements are available in providers (services / factories) and in directives (components / directives):
upgrade.bootstrap(document.body, ['heroApp']);
These two answers could help you:
angular 1.x and angular2 together
How to inject upgraded Angular 1 service/factory to Angular 2 component in ES5?
So the major problem in this case turned out to be the fact that it appears that the upgrade components aren't included as part of the basic angular 2 bundle. After adding:
<script src="node_modules/angular2/bundles/upgrade.min.js"></script>
to my index.html file the error I was seeing disappeared.
Thanks to the answer here for pointing me in the right direction!

Any conflicts between UI-Bootstrap and Twitter Bootstrap?

Are there any conflicts between Angular UI-Bootstrap and Twitter Bootstrap?
I am trying to avoid using jQuery-UI with AngularJS if a more Angular-friendly UI package is available. I already started with Twitter Bootstrap, so I do not wish to unload Twitter Bootstrap.
No, there are no conflicts. Especially since ui-bootstrap is dependent on Twitter Bootstrap.
From the linked docs:
This repository contains a set of native AngularJS directives based on Bootstrap's markup and CSS. As a result no dependency on jQuery or Bootstrap's JavaScript is required. The only required dependencies are:
AngularJS (requires AngularJS 1.3.x, tested with 1.3.13). 0.12.0 is the last version of this library that supports AngularJS 1.2.x.
Bootstrap CSS (tested with version 3.1.1). This version of the library (0.13.0) works only with Bootstrap CSS in version 3.x. 0.8.0 is the last version of this library that supports Bootstrap CSS in version 2.3.x.
If you are going all in on Angular then stick with either AngularStrap or Angular UI Bootstrap, do not mix it with Twitter Bootstrap JS library. Both of the Angular projects mentioned utilize the Bootstrap CSS, but they completely replace the Bootstrap JS library, with pretty much all functionality included.
Apart from the unnecessary bloat to load both libraries, you'll end up with issues integrating the Bootstrap JS library with Angular for stuff like model binding.

Resources