Anatomy of an AngularJS application

Saturday 21 May 2016


It is important to know the various components of the angularjs before implementing the angularjs application. Every agularjs application has following internal components,

1. Model
2. View
3. Controller
4. Scope
5. Directive
6. Expression
7. Template

Followings are the details of the above components,

1. Model :
  • Model represents the data which is used to display on the HTML pages/templates.
  • Model data are nothing but simple POJOs ( i.e Plain Old JavaScript Objects ).
  •  For example empName, password, empId, and empSal are the various data/models of an employee of an organization. So employee is a POJO which contains the data/properties as follows,
    employee = {
         empName: 'Jhon',
         password: 'jhon@123',
         empId: 10022,
         empSal: 26500
    }

2. View :
  • This is a HTML page or a piece of HTML code for displaying the data/model.
3. Controller :
  • It is the place where we write the business logics for driving the angularjs application.
  • Here the business logic is the piece of code to manipulate the data/model.
  • Every controller has a $scope which extends to $rootScope.
4. Scope :
  • It is a context which holds data models and function to operate the data models.
  • A controller sets these data models and functions in the scope.
5. Directive :
  • It is the new attribute/element to give more additional features/functionalities for our existing HTML elements.
  • For example ng-if, ng-repeat are built-in directive and <my-clock></my-clock>, my-clock are the custom directives implemented by us.
6. Expression :
  • Expressions are represented by {{}} in the HTML. They are useful for accessing scope models and functions.
  • For example <div> {{ 4 + 6 }} </div> which will display 10 on our view.
7. Template :
  • HTML with additional markup in the form of directives (<my-clock/>) and expressions {{}}.

21 comments:

  1. Thank you for this post. Thats all I are able to say. You most absolutely have built this blog website into something speciel. You clearly know what you are working on, youve insured so many corners.thanks
    Digital Marketing Training in Chennai

    Digital Marketing Training in Bangalore

    digital marketing training in tambaram

    digital marketing training in annanagar

    ReplyDelete
  2. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    Digital Marketing online training

    full stack developer training in pune

    full stack developer training in annanagar

    full stack developer training in tambaram

    ReplyDelete
  3. I have picked cheery a lot of useful clothes outdated of this amazing blog. I’d love to return greater than and over again. Thanks! 
    python training institute in chennai
    python training in Bangalore
    python training in pune

    ReplyDelete
  4. Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
    Blueprism training in tambaram

    Blueprism training in annanagar

    Blueprism training in velachery

    ReplyDelete
  5. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    Data Science training in kalyan nagar
    Data Science training in OMR
    selenium training in chennai
    Data Science with Python training in chenni
    Data science training in velachery

    ReplyDelete
  6. Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs Training in bangalore

    ReplyDelete
  7. Thanks for sharing the basic information . This post is very helpful for AngularJS development company in India. Thanks for the post.

    ReplyDelete
  8. Thank You..!
    For latest update contact our agency.We offer reliable AngularJS development services for our esteemed clients.
    AngularJs Development Company in Pune

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. Looking to Hire Wordpress Developer in India ? Hire wordpress developer from indian web developers. We are leading hire wordpress developer company provides custom wordpress developer services in India.

    ReplyDelete
  11. I needed to thank you for this good read!! I certainly enjoyed every bit of it. I've got you book-marked to check out new stuff you post…
    Gadgets

    ReplyDelete
  12. "Thank you for sharing information. AngularJS Online Training AngularJS Online Course is also providing detail concepts on AngularJS with practical examples."

    ReplyDelete

 
About Contact Career Advertise Job Support Online Training Acardemic Projects Internship
Copyright © 2016. [ info ].
Design by Herdiansyah Hamzah. & Distributed by Free Blogger Templates
Creative Commons License