Hi All i have a problem with my directive, i searched in the forum for any solution but i didn't found anything good for me.
I have a directive, in my html inside a ng-repeat and looks like this
<custom-slide item="{{slides[$index]}}" pos='$index' ></custom-slide>
I need to pass item this way beacause I need to watch if the value of this object changed in my main controller.
My directive scope is like this:
return {
restrict: 'E',
link: linker,
scope:{
item: '@item',
pos: '=pos'
//slide: '@slide',
}
my problem it if when i use scope.item what i get is a string and not an objetc.
{type:0, isSelected:'slide' ,param1:'',param2:' ',param3:' '}
But i get this as string,it's any way to have this as an object, without need to parse
any advice!!? thank you very much!
EDIT
i need to have item as an object because in my linker i change de template of the directive and,in this template i have somethings like:
<div>
<div class="mainText">{{scope.item.param1}}</div>
<div class="footer Text">{{scope.item.param2}}</div>
</div>
so when {{scope.item.param1 }}
is evaluated the value is undefined, because isn't an object