javascript - Angularjs ng-include directive not working -


i facing problem while using angularjs ng-include directive.i checked various tutorials,but still couldnt solve.i want display contents of 'title.html' inside 'index.html'. contents of 'index.html' :

 <html ng-app>     <head>     <script type="text/javascript" src="js/angular.min.js"></script>     </head>     <body>     <h1 ng-model="name">hello {{"name"}}</h1>     <h3 ng-include="'title.html'"></h3>     </body>     </html> 

contents of 'title.html': "sometext"

i expecting output this: hello name sometext

but "sometext" not displayed.please help

you don't need test.html inside single quotes. try this:

  <h3 ng-include="title.html"></h3> 

also, ng-include not working using file:/// protocol, make sure you're using web server.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -