简体   繁体   English

无法在angularjs对话框上应用CSS

[英]Cannot apply CSS on angularjs Dialog

I am creating a mobile application, where when you click on a button and a dialog window pops up. 我正在创建一个移动应用程序,当您单击按钮并弹出对话框时。 My problem is that this window is not responsive, and I cannot change its CSS. 我的问题是此窗口没有响应,因此我无法更改其CSS。

Here's the code: 这是代码:

Controller.js Controller.js

.controller('jargonController', ['$scope','$mdDialog','$mdMedia',function ($scope, $mdDialog, $mdMedia){

 $scope.status = '  ';

  $scope.showTabwtr = function(ev) {
    $mdDialog.show({
      controller: DialogController,
      templateUrl: 'templates/jargon/wtr.tmpl.html',
      parent: angular.element(document.body),
      windowClass: 'center-modal',
      targetEvent: ev,
      clickOutsideToClose:true
    })
        .then(function(answer) {
          $scope.status = 'You said the information was "' + answer + '".';
        }, function() {
          $scope.status = 'You cancelled the dialog.';
        });
  }

Index.html Index.html

<div class="col col-50" >
    <img  src="img/jargon/Image13.png" ng-click="showTabwtr($event)" style="width: 100%; height: auto"/>
</div>

Template 模板

<div class="modall">
    <img  style="max-width:200px; max-height:100px"src="img/description/Image17.png"/>
</div>

CSS 的CSS

.modall {

  margin: auto;
  position: relative;
  max-width: 200px;
  max-height: 80px;
  background: transparent;
}
$scope.showTabwtr = function(ev) {
    $mdDialog.show({
      controller: DialogController,
      templateUrl: 'templates/jargon/wtr.tmpl.html',
      parent: angular.element(document.body),
      windowClass: 'center-modal',
      targetEvent: ev,
      cssClass: 'your css name',
      clickOutsideToClose:true
    })

use this cssClass property 使用此cssClass属性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM