在Angular2中对FormGroup使用jquery步骤
请参见以下示例。我已经将在Angular2中对FormGroup使用jquery步骤,angular,typescript,jquery-steps,Angular,Typescript,Jquery Steps,请参见以下示例。我已经将jquery和jquery步骤加载到项目中,并且它正在工作。但是,渲染视图后,更改输入框中的数据不会更新表单组mainForm中的值。我认为原因是jquerysteps动态删除并重建了表单的html,因此表单组不再链接到DOMs 在jquery步骤重构html之后,有没有办法将FormGroupmainForm重新绑定到DOMs 我读到了关于组件解析器和ViewContainerRef,它应该在哪里使用这些组件?你能给我举个例子,在这种情况下如何使用它们吗 谢谢大家! 这
jquery
和jquery步骤
加载到项目中,并且它正在工作。但是,渲染视图后,更改输入框中的数据不会更新表单组mainForm
中的值。我认为原因是jquerysteps
动态删除并重建了表单的html,因此表单组不再链接到DOMs
在jquery步骤
重构html之后,有没有办法将FormGroupmainForm
重新绑定到DOMs
我读到了关于组件解析器
和ViewContainerRef
,它应该在哪里使用这些组件?你能给我举个例子,在这种情况下如何使用它们吗
谢谢大家!
这不起作用的主要原因是jquery步骤插件删除了html标记
在angular2中使用jquery是一个坏主意,但如果您想让它工作,我可以为您提供对库的轻微修改
jquery.steps.js
函数呈现(向导、选项、状态){
+var contentWrapper=$(''.format(options.contentContainerTag,“content”+options.clearfixcsclass));
+contentWrapper.append(wizard.children());
//创建内容包装器并从初始向导结构复制HTML
var wrapperTemplate=“{2}”,
方向=getValidEnumValue(stepsOrientation,options.stepsOrientation),
VerticalCSCLASS=(方向==步骤或方向.垂直)?“垂直”:“”,
-//contentWrapper=$(wrapperTemplate.format(options.contentContainerTag,“content”+options.clearFixCssClass,wizard.html()),
另请参见hi yurzui..我需要禁用“继续”按钮,直到满足确切的条件..例如:不填写用户名,用户不能允许继续(禁用按钮)。在角度上下文中,我如何才能做到这一点?谢谢
function render(wizard, options, state) {
+ var contentWrapper = $('<{0} class=\"{1}\"></{0}>'.format(options.contentContainerTag, "content " + options.clearFixCssClass));
+ contentWrapper.append(wizard.children());
// Create a content wrapper and copy HTML from the intial wizard structure
var wrapperTemplate = "<{0} class=\"{1}\">{2}</{0}>",
orientation = getValidEnumValue(stepsOrientation, options.stepsOrientation),
verticalCssClass = (orientation === stepsOrientation.vertical) ? " vertical" : "",
- //contentWrapper = $(wrapperTemplate.format(options.contentContainerTag, "content " + options.clearFixCssClass, wizard.html())),