• LxD Series: Using $http for AJAX

    So this is the last post related to AngularJS in LxD Series in today I am covering one of the most basic aspect of SPAs that is, interacting with backend systems. Angular comes with $http object that does something what many of us have been doing with $post/$get/$ajax methods of jQuery. Let’s jump into the code. So far we were using a predefined array having data of our records. It was something like this: [crayon-5cea920a49498568518917/] Which will now be changed to this: [crayon-5cea920a4949f676948439/] $http  object’s get method fetch a page. On successful return it sets data with data return from api.php which returns nothing but a JSON object. Rest is similar…

  • LxD Series: Implementing AngularJS templates and routers

    Ok so we are going to implement templates and routers in AngularJS. Routers are going to help us to get unique URLs per page, or view while templates, as you know will help to provide theme of our app. This is what we came up in my last post. What I am going to do to shift the markup of this listing in a separate file and come up with a layout. Therefore index.html will look like this: [crayon-5cea920a49962596813135/] You should notice that I removed all the stuff from content div and add another directive, ng-view. Ng-view tells AngularJS that particular DIV will be used as a container of multiple views. Now…

  • LxD Series: Starting AngularJS

    I am making this post after 20 days. I got busy as there was a new addition in my family. I am father of two sons now, thanks to God Almighty. Anyways, only a week is left in January. I will try to cover as much as I can so that we can have a minimal idea about AngularJS and it’s working so that we can start using it in our future projects. Running first program Ok So we are now going to run our first program but before that we need to setup AngularJS. If you visit AngularJS, you will see you can configure it in multiple ways(CDN,Download,Bower and npm).…