Could not understood moving code from index.html file to programListing.html


Hi I started exploring angular from yesterday and got idea to do programs. but In this project I could not understand 3rd point. Moving the .content area from index.html to programListing.html.


Just cut and paste the content of the div .content into the file programListing.html.

Doing so, you will have created your template.

      Thank you Alexandre Follin for your quick response.

Please correct my code if am going wrong
Here is my code for directives (js/directives/programListing.js):

app.directive('programListing', function(){
restrict : 'A',
scope: 'listing',
templateUrl : 'js/directives/programListing.html'

and as you suggested I move the code .content to js/directives/programListing.html.

Here i could not understand how to use listing attribute in view.
Please Reply


this line is not good

now you need to "call" your directive in your index.html, since you wrote

you will have to write an element (a div for instance) with an attribute program-listing.
This element should be replaced by your template if all goes right.


Thank you again
I will try this and let you know.. :grinning: