Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 带自定义选项和自定义标题的“角度材质$md”对话框_Angularjs_Angular Material - Fatal编程技术网

Angularjs 带自定义选项和自定义标题的“角度材质$md”对话框

Angularjs 带自定义选项和自定义标题的“角度材质$md”对话框,angularjs,angular-material,Angularjs,Angular Material,如何将标题和文本内容传递到自定义模板中。参数“title”有数据,但如何将该数据获取到自定义模板中?在下面的代码中,您可以看到我尝试了{{}和$scope genericYNCConfirmationWithCallback: function (title, textContent, callback, cancelCallBack) { showAlert(); function showAlert() { genericComfirmation = $mdD

如何将标题和文本内容传递到自定义模板中。参数“title”有数据,但如何将该数据获取到自定义模板中?在下面的代码中,您可以看到我尝试了{{}和$scope

genericYNCConfirmationWithCallback: function (title, textContent, callback, cancelCallBack) {
    showAlert();
    function showAlert() {
        genericComfirmation = $mdDialog.confirm({
            title: title,
            textContent: textContent,
            template: '<md-dialog>' +
            '  <md-dialog-content>' +
            '       <h2 class="md-title">title {{title}}</h2>' +
            '         <p>{{textContent}}</p>' +
            '           <p>{{$scope.textContent}}</p>' +
            '  </md-dialog-content>' +
            '  <md-dialog-actions> ' +
            '       <md-button ng-click="closeDialog()" class="md-primary">' +
            '           Yes</md-button>' +
            '       <md-button ng-click="closeDialog()">' +
            '           No</md-button>' +
            '       <md-button ng-click="closeDialog()">' +
            '           Cancel</md-button>' +
            '  </md-dialog-actions> ' +
            '</md-dialog>',
});

    $mdDialog
        .show(genericComfirmation).then(function (answer) {
            callback(answer);
        }, function () {
            cancelCallBack();
        })           
    }
},  
genericyncconficationwithcallback:function(title、textContent、callback、cancelCallBack){
showarert();
函数showAlert(){
genericComfirmation=$mdDialog.confirm({
标题:标题,,
textContent:textContent,
模板:“”+
'  ' +
'title{{title}}'+
“{{textContent}

”+ “{{$scope.textContent}

”+ ' ' + ' ' + ' ' + “是的”+ ' ' + “不”+ ' ' + “取消”+ ' ' + '', }); $mdDialog .显示(一般确认)。然后(功能(回答){ 回拨(应答); },函数(){ 取消回调(); }) } },
我就是这样解决的。。。。我刚刚结束了我的引用,并添加了如下参数

'       <h2 class="md-title">'+ title + '</h2>' +
'           <p>' + textContent + '</p>' +
“”+title+“”+
“”+textContent+”

”+