[英]Create modal page dynamically
I have a conceptual question, when i want create a modal in my page, always include the html
of my modal in the page, something like this : 我有一个概念性的问题,当我想在页面中创建模态时,请始终在页面中包含模态的
html
,如下所示:
<div class="my-modal">
<form action="/home/index">
<input type="text" class="txt-name"/>
<input type="text" class="txt-last-name"/>
<input type="submit" value="register!"/>
</form>
</div>
Usually i show this modal by jquery
plugins, like blockUI
and etc. Now i have some questions in my mind and i want to do the best: 通常,我通过
jquery
插件(例如blockUI
等)来显示此模式。现在我心中有一些疑问,我想做到最好:
html
page, but maybe the user doesn't need to using this, maybe he need another sections but i use the memory. html
页面中包括此部分,但也许用户不需要使用它,也许他需要其他部分,但是我使用了内存。 So i need a technique, plugin or etc. to handle these issues. 所以我需要一种技术,插件等来解决这些问题。 Any idea for this?
有什么想法吗?
UPDATE 更新
After some searches i think should use some libraries like requirejs
, but i don't know how... 经过一些搜索,我认为应该使用诸如
requirejs
库,但是我不知道如何...
RequireJS would load the template ondemand, but not the markup! RequireJS将按需加载模板,但不会加载标记!
Take an eyes to this: 注意一下:
Angular > ng-if > custom directives (transclude: true) Angular> ng-if>自定义指令(包含:true)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.