abernal's blog

Dependencies

We can split the application into diferent modules, for example we can create a new module called 'store-directives' that will store all the directives related to a specific part of the store

Example using product.js to store the module store-directives

Within the index.html, check the src="products.js"

Directive Controller

We can add controllers to our Custom Directives

Example

Suppose we want to convert this

​<section ng-controller="PanelController as panels">
    <ul class="nav nav-pills">...</ul>
    <div class="panel" ng-show="panels.isSelected(1)">...</div>
    <div class="panel" ng-show="panels.isSelected(2)">...</div>
    <div class="panel" ng-show="panels.isSelected(3)">...</div>
    <div class="panel" ng-show="panels.isSelected(4)">...</div>
</section>

to this

Pages

Subscribe to RSS - abernal's blog