Looks like it's working now:
http://plnkr.co/edit/Iksmm4LX5BH4dYrGAcux?p=preview

I changed scope: {} to scope: true




On Fri, Feb 14, 2014 at 7:52 PM, Claus Fjellø-Jensen <[email protected]
> wrote:

> I have updated the plunker:
>
> http://plnkr.co/edit/tC8LHvNKKKZAwrh8KwKs?p=preview
>
> so a quick recap:
>
>    - fromJson actually works and can be printed to console
>    - I have included a function on controller $scope that returns the
>    config object (initially set in the link function using scope.config = ...
>    ) and it returns a valid config object from controller $scope that can be
>    printed to console
>    - Using angular 1.2.12 the index.html does not display what was set on
>    scope in the link function
>    - Using angular 1.0.8 it all works
>
> Kind of weird - I guess I missed out on some change in Angular behavior
> that was made along the way?
>
> Br, Claus
>
>
> On Saturday, February 15, 2014 1:11:29 AM UTC+1, Claus Fjellø-Jensen wrote:
>
>> Hi Dave,
>>
>> You are right! - it is not the conversion that fails, it is the
>> assignment to link's scope that is not reflected in the controllers $scope
>> for some reason.
>>
>> I will post a new plunker when I figured out why that is.
>>
>> (The reason to configure the directive in  this way is that the actual
>> directive, an Ace editor with an optional toolbar and status line and a
>> varying number of rows, is that it is used in a number of places (sometimes
>> even in the same page) and can easily be configured from within the html to
>> include or exclude these features using ng-switches in the template).
>>
>> Br,
>> Claus
>>
>> On Friday, February 14, 2014 11:09:26 PM UTC+1, Dave Gruska wrote:
>>>
>>> Hi Claus,
>>>   I don't know if this gets you anywhere or not, but I got the JSON to
>>> show up as an object in the console:
>>>
>>> http://plnkr.co/edit/ZrvXKKemzToD9m0pU2Qc?p=preview
>>>
>>>   Not sure why you are doing the config in the HTML, though.
>>>
>>> On Friday, February 14, 2014 4:34:42 PM UTC-5, Claus Fjellø-Jensen wrote:
>>>>
>>>> Hi,
>>>>
>>>> I use the following JSON attribute for directives, that allows me to
>>>> configure the directive from the html:
>>>>
>>>> <my-drt config='{"useBold": false, "addButton": true, "identity":
>>>> "id_02", "msg": "scope_02"}' ></my-drt>
>>>>
>>>> As long as you stick to using constant values, you can read this
>>>> directly in the link function (without using a $watch function)
>>>>
>>>> My problem is, that 'fromJson' seems to fail silently when using
>>>> angular 1.2.12, as shown in this plunk:
>>>>
>>>> http://plnkr.co/edit/tC8LHvNKKKZAwrh8KwKs?p=preview
>>>>
>>>> If you change the angular.js script tag in index.html to: src="
>>>> http://code.angularjs.org/1.0.8/angular.js";, it all works again.
>>>>
>>>> Any suggestions?
>>>>
>>>> Br,
>>>> Claus Fjellø-Jensen
>>>>
>>>  --
> 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/7yrdaUzsOZE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to