Use jquery-steps with FormGroup in Angular2

前端 未结 1 747
臣服心动
臣服心动 2020-12-21 05:22

Please see the following examples. I have loaded jquery and jquery-steps into the project already and it is working. However after rendering the vi

相关标签:
1条回答
  • 2020-12-21 05:39

    The main reason why that is not working is that jquery-steps plugin removes your html markup.

    Using jquery in angular2 is bad idea but if you want to get it working i can offer you slightly modify the library

    jquery.steps.js

    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())),
    

    See also Plunker Example

    0 讨论(0)
提交回复
热议问题