如何调用ng-click on mdt-custom-cell attribue

时间:2016-09-23 18:24:27

标签: angularjs angular-material

        <mdt-custom-cell html-content="true" column-key="role">
        <!-- <span ng-class="{'red': value > 5, 'green': value <= 5}">    {{value}}</span> -->
         <button ng-click="showTabDialog($event)"  class="btn btn-success">Order Now </button>

    </mdt-custom-cell>

这是我的材质 - 数据表的html代码。我的函数是..

     $scope.showTabDialog = function(ev) {
              console.log("hello");
                $mdDialog.show({
                controller: 'addToPrintListDialog',
                templateUrl: 'views/dashboard/addToPriceListDialog.html',
                parent: angular.element(document.body),
                targetEvent: ev,
                clickOutsideToClose:true
              })
          .then(function(answer) {
            $scope.status = 'You said the information was "' + answer + '".';
          }, function() {
            $scope.status = 'You cancelled the dialog.';
          });
      };

这不仅适用于自定义单元格。是否有任何其他替代方案可以使其工作,如果不是这样的话。

1 个答案:

答案 0 :(得分:0)

您应该按照here使用clientScope.showTabDialog($event)