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
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.