Skip to content

Commit

Permalink
Namespace directives to futureproof
Browse files Browse the repository at this point in the history
  • Loading branch information
snapjay committed Dec 4, 2014
1 parent 15a963b commit aa4f8c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Something like this:
Renders an 'Add To Cart' Button

```
<addtocart id="{{ item.id }}" name="{{ item.name }}" price="{{ item.price }}" data="item">Add To Cart</addtocart>
<ngcart-addtocart id="{{ item.id }}" name="{{ item.name }}" price="{{ item.price }}" data="item">Add To Cart</ngcart-addtocart>
```


Expand All @@ -66,7 +66,7 @@ Renders an 'Add To Cart' Button
Renders a view of the cart

```
<cart></cart>
<ngcart-cart></ngcart-cart>
```


Expand All @@ -75,7 +75,7 @@ Renders a view of the cart

Renders a summary of the content of the cart (Typically used in the header bar of a website
```
<summary></summary>
<ngcart-summary></ngcart-summary>
```


Expand Down
8 changes: 4 additions & 4 deletions src/ngCart.directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ angular.module('ngCart.directives', [])

}])

.directive('addtocart', ['ngCart', function(ngCart){
.directive('ngcartAddtocart', ['ngCart', function(ngCart){
return {
restrict : 'E',
controller : 'CartController',
Expand All @@ -32,7 +32,7 @@ angular.module('ngCart.directives', [])
};
}])

.directive('cart', ['ngCart', function(ngCart){
.directive('ngcartCart', ['ngCart', function(ngCart){
return {
restrict : 'E',
controller : 'CartController',
Expand All @@ -44,13 +44,13 @@ angular.module('ngCart.directives', [])
};
}])

.directive('summary', ['ngCart', function(ngCart){
.directive('ngcartSummary', ['ngCart', function(ngCart){
return {
restrict : 'E',
controller : 'CartController',
scope: {},
transclude: true,
templateUrl: 'template/ngCart/summary.html'
};
}])
}]);

2 changes: 1 addition & 1 deletion template/ngCart/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</div>
<div class="col-md-6">{{ ngCart.totalItems() }}
<ng-pluralize count="ngCart.totalItems()" when="{1: 'item', 'other':'items'}"></ng-pluralize>
<br/>{{ ngCart.totalCost() | currency }}
<br />{{ ngCart.totalCost() | currency }}
</div>
</div>

0 comments on commit aa4f8c0

Please sign in to comment.