Skip to content

Commit cce75ff

Browse files
committed
Exposed the directive as an attribute as well. The directive can now be bound to an element with the 'zingchart' attribute
1 parent f632d3b commit cce75ff

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ An AngularJS directive for ZingChart to make your charts work dynamically with y
55

66
#### Try out our demo! http://zingchart.github.io/ZingChart-AngularJS
77
#### Full blog post @ http://www.zingchart.com/blog/2015/03/05/zingchart-angularjs/
8+
9+
---
10+
11+
Note: As of v1.0.1, the attribute is now exposed to the directive allowing you to bind the zingchart directive to an actual DOM element along with the `<zingchart>` element. This will allow you to utilize percentage values in the height/width render options by maintaining a DIV's inherit properties. The following are equivalent :
12+
13+
`<div zingchart zc-values="myValues"></div>`
14+
15+
`<zingchart zc-values="myValues"></zingchart>`
16+
817
## Install
18+
19+
920
```
1021
bower install zingchart-angularjs
1122
```

src/zingchart-angularjs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
angular.module('zingchart-angularjs', [] )
44
.directive('zingchart', [function(){
55
return {
6-
restrict : 'E',
6+
restrict : 'EA',
77
scope : {
88
zcValues : '=',
99
zcJson : '=',

0 commit comments

Comments
 (0)