The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Building Zippy

Building Zippy

7:55
Building a demo AngularJS directive named Zippy using ng-model, ng-click and transclusion (no controller)
Watch this lesson now
Avatar
egghead.io

Building a demo AngularJS directive named Zippy using ng-model, ng-click and transclusion (no controller)

Avatar
glasson

Are following scopes the same?
- the scope defined in the object returned by the directive definition,
- and the scope used in the link function???
If yes, would it mean that I could move the field isContentVisible and the function toggleContent into the upper scope definition??
Thank you in advance!

In reply to egghead.io
Avatar
Roman Ganchenko

what do you mean in upper scope definition?
Do you mean in controller scope? If yes, the answer is Yes, you might do so, but then you will have to wrap your html into ng-controller, so it will have the same scope

In reply to glasson
Avatar
Rai

Could you please update the source for angular 1.2? I can't seem to get this to work :(.

In reply to egghead.io
Avatar
Joel

Could you please update the source for angular 1.2? I can't seem to get this to work :(.

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

It works as expected with 1.2.14. What issues are you having?

In reply to Rai
Avatar
Rai

well... this is embarassing.

just tried again and it works.

not sure why I was having so many issues before!!

Thanks!!!

In reply to Joel
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?