javascript - Passing value through the ng-include tag -


i new angular js. have requirement values database user.html. in page (user.html) need call details.html using ng-include tag call details.html. while calling need pass values details.html, value dynamic, dynamic value need pass details.html.

example:

routemanager.js:  .when( '/mydetails', {   templateurl : "./client/assets/views/user.html",   controller  : "mydetailscontroller"  })  user.html:  <div ng-include="'client/assets/views/details.html'" {{here need pass 2 parameters }}></div>  details.html:  <h1>{{need display 2 parameters}}</h1> 

note: details.html there not controller. need without controller.

you can use onload:

<div ng-include="'mycomponent.html'"      ng-controller="mycomponentcontroller"      onload="myitem = myitemvalue"> </div> 

this recommended way in documentation.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -