1
指令這是我的指令單元測試角JS使用依賴
.directive('xDirective', ['x', 'y', function (x, y) {
return {
restrict: 'CA',
link: function (scope, element, attrs, messaging) {
//console.log(scope);
//console.log(element);
//console.log(attrs);
if (x.isResponsive && x.responsiveMode === y.responsive.mode.phone) {
//set the height of the header based on the device height
var offset = (attrs.heightOffset ? attrs.heightOffset : 0);
element.css("height", (x.device.height - offset) + 60 + "px");
}
}
};
}])
其中x和y是依賴於directive..i想單元測試這個directive..how做我繼續用茉莉花。
謝謝。