Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Angular 2 Architecture

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 350
    Comment on it

    Angular 2 architecture consists of module , component , template , metadat , data binding , service , directive and dependency injection.Some of them are :

    1. Module
    2. Component
    3. Template
    4. Metadata


    A module is a block of code that is used to perform a single task. We can build our application using these modules. Component class can be exported from a module. We can use the export statement to export the component class from the module.

    export class TestComponent { }

    The export statement tells us that this is a module and its TestComponent class is defined as public and it can be accessible by other modules of the application.


    A Component is a basic building block for angularJS application.It is simply "a part of the web page" .


    This tells the angular how to display the component.

     The name is : {{name}}

    We put the template expression inside the interpolation braces to display it is value.


    It is a way of processing a class.Suppose we have a component name TestComponent which will be treated as a class until we tell the Angular that it is a component. For this purpose, we can use metadata to tell the angular that TestComponent is a component. Metadata is attached to typescript using the decorator.

       selector : 'testlist',
       template : '<h2>Name is Rahul</h2>'
       directives : [TestComponent]
    export class TestComponent{ }



 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: