Tuesday, 29 September 2015

Angular structure and remote templates

At weekend I tried to clean my Angular project and move modules to separate files and folders. I did this but at the beginning nothing was working. I defined separate modules like:

angular.module('App', []);

In this square brackets I have to put names of other modules that are required to use in that App. That modules are injected by name.

angular.module('App', ['MyValidators','MyFilters']);


I exclude html templates to external files and use them by url.

<div .... ng-include="'templates/myTemplate.tpl.html'" />

No comments:

Post a Comment