这是我的指令
.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 是指令的依赖项..我想对该指令进行单元测试..我如何继续使用 jasmine。
谢谢。