Angular quick tip – Put declarations before exports

Sunday, May 21, 2017

This is a very short post about exporting component from angular module. On your NgModule decorator, you should assign the declarations before your export member otherwise when trying to use your exported components/ directives / pipes, you will encounter an error message of unknown element / attribute. Remember this, it can save you valuable time.
tags: ,
no comments

Slides and demo codes from front-end IL meetup

Thursday, September 29, 2016

On Tuesday I have had the pleasure of speaking about Angular 2.0 change detection mechanism, at front-end IL meetup, after Ori Calvo's session about redux. I want to thank all attendees who stayed and waited with us until the lecture began and especially to the one who stayed until the end. Slides for this session can be found here. The code for that session can be found here ,  
no comments

Slides and demos from angularJs migration session.

Thursday, August 11, 2016

Yesterday, I've had the honour and pleasure of speaking at Front-End.IL meetup   about angularJs code migration from angular 1.x to angular 2.0. I want to thank all attendees for their participation and feedbacks. The code presented on this meetup can be found here and the slides may be watched here Thanks again for your participation, I hope to see you soon in other meetup sessions.  
no comments

(Update) Finding current URL with Angular 2.0 Routing

Thursday, June 23, 2016

Previously I’ve posted about finding current URL with Angular 2.0 Routing which was suitable for rc-1. On Angular 2.0 rc-3, the angular router (alpha 3.0.0) has been added to the repository with much easierAPI for getting the current URL. Let’s have a look at the following code (Typescript) 1: constructor(private _router:Router){ 2: 3: } 4:  5: ngOnInit():any { 6: this._router.subscribe(event => { 7:...
no comments

Slides and demo codes from WDCIL meetup

Wednesday, June 22, 2016

Yesterday I’ve had the honor of speaking at WDC-IL neetup about async patterns in javascript. I wish to thank all attendees and WDC-IL for having me.   All demos presented on the meetup are available here You may view the slides here:  
no comments

Angular 2.0 Http client quick tip for firefox

Tuesday, June 14, 2016

  When getting HTTP response from a REST API using Angular 2.0 HTTP client you will probably won’t mess around with your request headers. You’ll probably count on the service to return a JSON formatted response,  subscribeto this response and go ahead using it’s .json()  method which will use JSON.parse of your browser API.   However, while this solution works fine using chrome,  Firefox behave differently. While in chrome, the HTTP Accept headers will be */* , on Firefox it will put text/html,application/xhtml+xmlwhich basically will cause your server side to return its response in XML form.   Therefore...
one comment

Finding current URL with Angular 2.0 Routing

Tuesday, June 7, 2016

  For an application built with AngularJs 2.0 (rc1) I wanted to do one simple thing: To highlightthe current active navigation  bar item. However, I’ve had to do it with the new angular router, the one that currently lacks documentation. So after a few searches online and digging through the router object I’ve reached the solution I want to share.   Let’s start with the solution itself: (Taken from the application’s entry component) 1: constructor(private router:Router){ 2: router.changes.subscribe(route =>{ 3: ...

Angular 1.x–Finding error in module using small recursion

Monday, April 25, 2016

Recently, to have an application angular 2.0 ready I’ve divided an angular 1.5 application to small modules. Of course this process wasn’t a straight forward one, however finding where there is a missing or error module was critical, otherwise I’ll get an error message on the main module I have a little to do with. Therefore, I’ve built a small recursive function, using the module.requires array property (available from v1.2) , which I want to share: 1: function getModule(moduleName){ 2: console.log('Getting module ' + moduleName); 3: var...
one comment

What to do when Visual Studio 2015 hangs while loading a solution

Thursday, March 10, 2016

From time to time, my visual studio got stuck, in previous versions I used to erase the <solution>.suo filehowever on visual studio 2015 I couldn’t find one.   I couldn’t find it because Visual Studio started behaving like other IDEs and put its solution user option file among other in a subfolder. So the .suo file moved to <Solution Dir>\.vs\<Solution Name>\v14\.suo (no file name, just the extension)   Erasing the SUO file has brought my Visual Studio on its feet again, however, what actually caused it to hang was the fact that I left too many files opened, but...
no comments