--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/ltScZz-c1Fk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Hi Jonathan,
Somehow I could not save my updated plunk..
Well,it look like you misunderstood the use of the controller property of the DDO (Directive Definition Object)
If you put in a the property like you did in your example, every instance of your directive will receive a brand
new MainViewCrtl. It seems you are not even using that in your code anyway.
As your directive has an isolate scope, the easiest way to put in the config var is like this:
app.directive('json', function($compile, $timeout) {
console.log("json directive.");
return {
restrict: 'E',
//controller: 'MainViewCtrl',
scope: {
child: '=',
type: '=',
config: '='
}, //rest of directive unchanged, and unchecked by me!
and in your HTML you do:
<json child="jsonData" type="'object'" config='config'></json>
Does this help?
Regards
Sander
The plunk did save now: http://plnkr.co/edit/IaudPZ?p=preview
--