Monday, May 5, 2014

Angular js (Client Side MVC)

App :- Today world is world of apps
      >> andriod app
     >> window phone app
     >> ios app
     >> web app
     >> sharepoint 2013 app
& REST service (say mvc web API , Sharepoint 2013 REST etc)

the programmer wants all code should be use client resource to increase the performance of the application .

Angular js :-

AngularJS is an open-source web application framework, maintained by Google and community, that assists with creating single-page applications, one-page web applications that only require HTML, CSS, and JavaScript on the client side. Its goal is to augment web applications with model–view–controller (MVC) capability, in an effort to make both development and testing easier.

Why Should I Use It?

If you haven’t tried AngularJS yet, you’re missing out. The framework consists of a tightly integrated toolset that will help you build well structured, rich client-side applications in a modular fashion—with less code and more flexibility.
 very nice to make Single Page App (SPA)

angular js works on client browser and provide an experience of window like app in browser using REST

it works on 

Model
Controller
View                   it is  client side architecture

Model : the data repository / data factory which may standalone json or list or get  request to REST api
View : the html which show the Model data
Controller : intermediate b/w model and view to perform action such as click (ng-click) or other operations.

it has capability to show numbers of the html pages on a single page without a single postback.
(using ng-view tag of angular js and angular routing)

url of the these app generally contain #  to manage number of page in single page.
like : http://sunitkanyan.in/app/WeatherApp/index.html#/city
        http://sunitkanyan.in/app/WeatherApp/index.html#/city/Kaithal 
        http://sunitkanyan.in/app/WeatherApp/index.html#/city/Chandigarh


demo app http://sunitkanyan.in/app/WeatherApp/index.html
(this app use REST api of weather channel)

basic concept angular js




demo basic angular js  http://sunitkanyan.in/app/AngularjsFirstApp/index.html
(this app use no server side resource all are in browser)


-
Sunit Kanyan