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]
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]
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.
Yes what I was missing was , initializing an model from directive along with object & property variable ie. $scope.Obj.proper = true ;