programListing.js What is the scope?


#1

Can someone help me figure out the scope for this?

The code I have is below but I don't believe it's correct???

scope: {
  listing: '=',
},

#2

From the subject :

"Use scope to specify that we'll pass information into this directive through an attribute named listing".

What you did would have been right if the subject was:
"Use scope to specify that we'll pass listing into this directive through an attribute named listing".

Good to know:

 scope: {
  a: '=b'
}

is like you said "I'm looking for attribute b, and i will save it in a"

Hope I could help


#3

I copied the same code but I am not able to view anything??


#4

my code was just an example... Doesn't fit with the subject.


#5

var app = app.directive("Directive", function() {
return {
restrict : "E",
scope: {
listing: "="
},
template: "js/directives/programListing.html"
};
});