(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

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

JSON.tryParse with Promise

Wednesday, September 9, 2015

JSON.parse is a method you must have used one or twice. And you must remember that it raises exception, as almost every parsing string in case the string comes in a wrong format. So, how about having a function that returns promise, so you can safely parse JSON's  and receive its result on the promise's "then" method. Here's some small code example: JSON.tryParse('{"a" : 1}').then(function(result) { //do something with the result }, function(error) { //do something with the error }); And here's the link to its gist: https://gist.github.com/ranwahle/2d38730af21909dd70a2
no comments

My SDP sessions demo code and slides

Thursday, June 4, 2015

This week I’ve had the honor of delivering one workshop and two breakout sessions at Sela Developer Practice . I wish to thank all attendees. Here are links to all slides and demos 1. angularJs from 0 to 60  workshop: Slides and Demo code     The presentation is based on a presentation written by Moshe Levy   2. What’s new in angularJs 2.0 Slides and Demo codes   3. Introduction to WebComponents Slides and Demo code      Thank you all and see you all at the upcoming conventions.  
no comments

Reading GPS data using exif-Js

Wednesday, January 7, 2015

Reading GPS data using exif-Js   Recently I was asked to get location data (latitude & longitude) from an image file. So I’m here to share with you exif-js library  which I came across with so I can easily read location data from an image file. EXIF stands fro Exchangeable Image file Format which is the standard for image files enables as to extract meta data from the image along with the image itself.Some of the meta data relates to the location the image was taken, assuming that it was taken with a GPS  or another location tracking...
3 comments

My AngularJs workshop at Sela’s SDP

Monday, December 29, 2014

Yesterday, I delivered a full day workshop about angularJs . I wish to thank all attendees. You may view the presentation here Demo code + server side components can be downloaded here The presentation was based on Sela’s former workshop made my Moshe Levyand contained few updates.
no comments