Tag Archives: npm

My experience with Angular2 – (project and npm package)

Angular2, AngularJS, Javascript

I have about 2 year with Angular, with the first version, and I have a some repos with that about a little experiments for specifics ideas.

Here, my last repo: https://github.com/dimaslz/angular1.x-es6-webpack

And now, from some months ago, I have started to test with Angular2, the new tendency :). As you can know, now Angular2 is  oriented by components, like ReactJS. You can see that all files are like “directives”, and the control into this class is the controller. I will talk about only some differences and curiosities, I will not enter in deep how to work with Angular2.

Now, in your template, you and use the component like  <app></app>,<div app></div>,<div class="app"></div> in the html as previous version. Is not necessary add ng-app, ng-controller like Angular1.x.

The component that you want use in html (app for example), should be have this code:

Other thing that has changed, is the service, provider and factory not exist, only Service.

Ran out the doubts about if we should use service, provider or factory to do a service.

And other thing important for me, is that now is very easy to do a load lazy a component, you have not use libs like ocLazyLoad

Finally, Angular2 is very very easy to learn, the transition from Angular1.x it has been confortable, only you need to dedicate time to search and try thing to understand.

During my learning, I tried to do a component and also I published it for know how to do a library and install it in other project, and was born the following npm package:

And I did the component ng2-notify

This component is for show a notification in the UI when you do some action. You can see a demo in following url: http://dimaslz.github.io/ng2-notify/ ( https://github.com/dimaslz/ng2-notify ) Now, it is a 1.3.o version with Angular2 Beta 9.
Please!! if yo have some doubt, find some bug or you want a feature, let me know and open a Pull Request about.


So, it is all, if you want show a little project, I did (I am doing fix and improvements little by little) a little project http://todoapp.dimaslz.io/#/tasks/allhttps://github.com/dimaslz/todoApp-angular2 ) with gulp, nodeJS + MongoDB for API, SASS (compass).

Thanks for read me, I hope that my experience that helped you.

tags: , , , ,