background preloader

Comment utiliser AngularJS2

Facebook Twitter

Hello world

Angular: 5 Rookie Mistakes to Avoid with Angular 2. You may have felt the tremors reverberating from the bowels of Twitter or elsewhere about writing pure Native mobile apps in JavaScript.

Angular: 5 Rookie Mistakes to Avoid with Angular 2

This is not hybrid, Cordova or webviews. These are truly native, 60fps mobile applications written with JavaScript. But that leaves one wondering: If there is no webview, how can I re-use my application code between the web and my mobile app? The answer is you need a JavaScript framework smart enough to do it, and a mobile runtime powerful enough to support it. Creating Your First Angular 2 Components. The Fesh Chronicles.

This is post 7 of 8 in the series “Using Angular 2 with Webpack” Reading time: A disclaimer: I’m not claiming to be an expert here and I’m open to any corrections or input from everyone; this is just what’s worked for me so far.

The Fesh Chronicles

Please enjoy! As I mentioned in the first post of this series, this series looks […] Continue reading → This is post 6 of 8 in the series “Using Angular 2 with Webpack” Reading time: A disclaimer: I’m not claiming to be an expert here and I’m open to any corrections or input from everyone; this is just what’s worked for me so far.

Please enjoy! Angular 2 – Hello World App – Typescript. Hi guys.

Angular 2 – Hello World App – Typescript

I’ve been working with Angular 2 for the past week, so thought I must share whatever I’ve learned. I’ll be writing a series of blog posts on Angular 2. What better way to start the series than to do an hello world app.. Let’s get started. Before we start, make sure you have node installed. Create a new folder named angular-hello-world. Copy the following contents into their respective files. package.json tsconfig.json typings.json Navigate to the angular-hello-world folder in the terminal and type the following command: $ npm install This will install angular and all the other required libraries. Create a folder named app inside the angular-hello-world folder.

Copy the contents into their respective files: main.ts import {bootstrap} from 'angular2/platform/browser'; import {AppComponent} from '. app.component.ts Create a file index.html in the angular-hello-world folder and copy the following: Creating Custom DOM Events in Angular2. In a tl;dr fashion I wanted to paint a picture of the use case for an custom event like this: You are creating a modal that a user will use, and you want to call your `closeModal()` function when the user clicks outside of the modal element.

Creating Custom DOM Events in Angular2

To do something like this you can extend the functionality of the EventManagerPlugin. While also doing a little search-sky I found another class which already extends EventManagerPlugin called DomEventsPlugin which was already using the abstracted DOM token for platform safety. (IE Webworkers, Servers, etc.) DomEventsPlugin decided to be an easier class to extend since all the extra work of extending EventManagerPlugin had already been taken care of. I wasn’t quite sure what the difference was between addEventListener() and addGlobalEventLisenter() until I started to hack around with it. AddEventListener: Fires when you use events from the DOM: addGlobalEventListener: Fires when you use events from anywhere (including seen here in the hosts tab. Finally! Angular. You may have felt the tremors reverberating from the bowels of Twitter or elsewhere about writing pure Native mobile apps in JavaScript.

Angular

This is not hybrid, Cordova or webviews. These are truly native, 60fps mobile applications written with JavaScript. But that leaves one wondering: If there is no webview, how can I re-use my application code between the web and my mobile app? The answer is you need a JavaScript framework smart enough to do it, and a mobile runtime powerful enough to support it. Angular 2 is that framework, and NativeScript is that runtime. In this article, I'm going to show you how to create a single application with Angular 2 that can be rendered on the web, or rendered in a native mobile application with NativeScript.