0

I am trying to access a model which resides in template of directive. But directive's scope never displays that model. What wrong I'm doing ?

http://jsbin.com/xorujuqube/edit?html,js,console,output [JSBIN-Reference]

Ronny
  • 3
  • 1

2 Answers2

0

http://jsbin.com/facotegene/1/edit?html,js,console,output

couple of things, when you pass a variable from parent, you just use of: "=" (this will create a 2-way binding between parent and directive). Second, <test-d of="'test'"></test-d> expects an angular variable ($scope or var attached to Ctrl). so you must use quotations like this if you just want to test it with a string.

SuperVeetz
  • 2,128
  • 3
  • 24
  • 37
0

Yes what I was missing was , initializing an model from directive along with object & property variable ie. $scope.Obj.proper = true ;

Ronny
  • 3
  • 1