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


#1

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.


#2

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

Doing so, you will have created your template.


#4
      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(){
return{
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


#5

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.


#6

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