Because I am using ngInclude
to switch different templates, each template contains the same form to call the same functions in the controller. I want to include a defined variable, like a table name, to the ngModel
, so I can use it to filter the data in either js code or PHP code, in order to insert the information into the right table.
I did some researches but did not find any. Does anyone knows how to do it, or have better idea how to do it?
Thank you
You can use angular ui-router
instead ngInclude
for loading html template, then you can pass data as variable
take a look at this https://angular-ui.github.io/ui-router/site/
抱歉,这是一个愚蠢的问题,我只解决了一个问题,我在Submit函数的参数中添加了一个值,例如ng-click="submit(file, 'poster')"
,然后使用它来处理js代码并PHP代码。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.