角度js中的外部文件

时间:2014-03-03 12:58:49

标签: javascript jquery angularjs

我有一个Angular应用程序。我在我的应用程序中创建了一个运行正常的组合框。我可以从我的依赖列表中选择 - > dependedQuestions。

<div class="dependedQuestion customizedSelect">
     <select class="T14" ng-model="selectedQuestion.selectedDependedQuestion" ng-options="question.number for question in dependedQuestions"></select>
</div>

我创建了一个名为popup.js的外部文件。 在这个文件中,我调用了jquery ui的对话框。

功能:

function dialogWithTwoButtonsComboboxAndTextbox(message,title,callbackOnOK, callbackOnCancel){

var htmlString = "<div id=\"modalConfirm\" title=\""+title+"\">" +
                    "<div class=\"questionnaireAttributesBlockDialog\">" +
                        "<div class=\"questionInformation\">" +
                            "<div class=\"dependencyInstruction questionnaireLabels bold oronCondMFMediumA\"> dependencies</div>" +
                                    "<div class=\"chooseDependedQuestion\">"+
                                        "<div class=\"dependencyQuestionLabel marginLeft1 oronCondMFMediumA fontSize16Px\">שאלה:</div>"+
                                        "<div class=\"dependedQuestion customizedSelect\">"+
                                            "<select class=\"dependedQuestionCombobox fontSize16 oronCondMFMediumA T14\" name=\"typeValidation\" ng-model=\"selectedQuestion.selectedDependedQuestion\" ng-options=\"question.number for question in dependedQuestions\" ng-blur=\"createDependencyOnlyIfTextboxFilled()\"></select>" +
                                        "</div>" +
                                    "<div class=\"chooseDependedQuestion\">"+
                                        "<div class=\"dependencyQuestionLabel  oronCondMFMediumA fontSize16Px\">answer</div>"+
                                        "<input type=\"text\" id=\"optionalValuesForAnswer\" ng-model=\"selectedQuestion.optionalValuesForDependedQuestion\"/>" +
                                    "</div>" +
                                "</div>" +
                            "</div>" +
                        "</div>" +
                    "</div>" +
                "</div>"; 

    defineDialogPopUp(htmlString, message,title, callbackOnOK, callbackOnCancel);
}

函数defineDialogPopUp:

 function defineDialogPopUp(htmlString,message,title, callbackOnOK, callbackOnCancel){
    var dialogButtons = {};
    var approveButtonText = messageToUser.dialogOkButton;
    var cancelButtonText = messageToUser.dialogCancelButton;
    dialogButtons[cancelButtonText] =   { text: cancelButtonText,
                                            class:'btnCancel btnDialog',
                                            click:function() {
                                                if (callbackOnCancel != null)
                                                    callbackOnCancel();
                                                $(this).dialog( "destroy" );
                                            }
                                        }

    dialogButtons[approveButtonText] =  {   text: approveButtonText,
                                            class:'btnApprove btnDialog',
                                            click:function() {
                                                callbackOnOK();
                                                $(this).dialog("destroy");
                                            }
                                    };
    $(htmlString).dialog({
        height: 300,
        width: 500,
        modal: true,
        resizable: false,
        buttons:dialogButtons
    });
}

问题是它显示但是组合框不起作用。我想因为它没有棱角分明? 我该怎么办?我提醒你,我需要向用户打开一个对话框。

1 个答案:

答案 0 :(得分:0)

尝试使用Angular UI而不是使用jquery Ui。 http://angular-ui.github.io/