Understand Angular 1 and Angular 2 Directive Structure


Angular 2 still in development phase and Alpha version launched. And many developers already started to explore Angular 2. When we start to learn Angular 2 first we need to understand how to maintain project structure in Angular 2 project.

Today I am showing how to maintain project structure in Angular 1 and Angular 2 project.

Angular 1 Directive Structure


In Angular 1 we put all JavaScript file in separate folder and use “template” folder for templates. “js” folder contains all JavaScript files.

Mostly developer create different JavaScript files based on module and one different files for configuration and services. We make one folder for components.
Following is an example of directive structure in Angular 1 projects.






Angular 2 Directive Structure


Angular 2 directive structure very different then Angular 1. Because Angular 2 based on component base setup.
In Angular 2 JavaScript and html files contains related module. We organizing project looks like a component.



Keywords - 

Understand Angular 1 and Angular 2 Directive Structure

Directive Structure in Angular 2


Previous
Next Post »
Thanks for your comment