[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://*.com/a/19951141 option 4)
parentElement.data('$comCardBigController', mockParentController); const compiledDirective = compile(parentElement)($scope).find('com-cycle-data-chart');
$scope.$digest();
return compiledDirective;
}
上一篇:Python中的GIL


下一篇:C语言中将字符串转换为数字的方法