Conversation
You can now insert config in your directive with something like:
```
<div ng-if="piwikConfig.active">
<ngp-piwik ngp-set-js-url="{{piwikConfig.urlJs}}"
ngp-set-tracker-url="{{piwikConfig.urlPhp}}"
ngp-set-site-id="{{piwikConfig.siteId}}">
</ngp-piwik>
</div>
```
using:
app.constant('piwikConfig', {
active: true,
urlJs: "http://mypiwiksite.com/piwik.js",
urlPhp: "http://mypiwiksite.com/piwik.php",
siteId : 3
});
|
This looks great, thanks for the PR. I'd love to merge after a couple minor changes:
Thanks again! |
|
Well, I'll see when I'll have more time.. I tried to commit the files from git CLI but i'm not a contributor, so it's a bit hard to have it all in one single commit. For this PR, I copied/pasted in the online editor. |
|
Or i can work on a fork too... |
TestingYes, believe it is appropriate to have tests for this functionality. It would not require a new test per se, but the inject ($rootScope, $compile, $window) ->
elm = angular.element '''<div>
<ngp-piwik
ngp-set-js-url="{{piwikConfig.urlJs}}"
ngp-set-tracker-url="{{piwikConfig.urlPhp}}"
ngp-set-site-id="{{piwikConfig.siteId}}"
ngp-set-domains="www.test.com,demo.test.com">
</ngp-piwik>
</div>'''
scope = $rootScope
$window['_paq'] = undefined
win = $window
$compile(elm)(scope)
scope.$digest()
return
returnand stick the config on scope or as a constant in your example. SquashingSounds like you need to add your fork as a remote on the CLI: git remote add merlosy git@github.com:merlosy/angular-piwik.gitIf you use the hub app, you can just run Now that you have your fork's branch locally you can squash the commits. There are multiple approaches to squashing, but rebasing is one option, as described here http://eli.thegreenplace.net/2014/02/19/squashing-github-pull-requests-into-a-single-commit Also, I am happy to squash the commits and merge them to master once this is ready to merge. |
You can now insert config in your directive with something like:
using a definition of your constant like: