zoukankan      html  css  js  c++  java
  • [Unit Testing] Directive testing, require parent controller

            function getCompiledElement() {
    
                  $scope.chart = {
                    additional: "$ 1.56 / per minute",
                    text: "phoneCard.voice",
                    total: 250,
                    unit: "MIN",
                    used: 127
                };
    
                const
                    mockParentController = {
    
                          onClick( target ) {
                              selectedChartType = target;
                          }
                    },
                    parentElement = angular.element('<div><com-cycle-data-chart chart="chart" service-type="voice"></com-cycle-data-chart></div>');
    
                // http://stackoverflow.com/a/19951141 option 4)
                parentElement.data('$comCardBigController', mockParentController);
    
                const compiledDirective = compile(parentElement)($scope).find('com-cycle-data-chart');
                $scope.$digest();
                return compiledDirective;
            }        
  • 相关阅读:
    洛朗级数
    泰勒级数
    中心极限定理
    置信区间公式
    简单随机样本的性质
    极大似然估计
    矩估计法
    摆摊70
    天天去哪吃
    天天和树
  • 原文地址:https://www.cnblogs.com/Answer1215/p/5221216.html
Copyright © 2011-2022 走看看