This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Directive, HostBinding, Input, OnChanges, SecurityContext, SimpleChanges} from "@angular/core"; | |
import {DomSanitizer, SafeHtml} from "@angular/platform-browser"; | |
@Directive({ | |
selector: "[appHighlight]", | |
}) | |
export class HighlightDirective implements OnChanges { | |
@Input() | |
searchTerm: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {clearMocks, Mock, mockClass, initMocks} from "mockclass"; | |
import {ErrorService} from "../components/http/error.service"; | |
describe('MyService', () => { | |
//use as a decorator in an empty holder class | |
class Mocks extends MockHolder { | |
@Mock(ErrorService) | |
errorService: ErrorService; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Animation} from "ionic-angular/animations/animation"; | |
import {isPresent} from "ionic-angular/util/util"; | |
import {PageTransition} from "ionic-angular/transitions/page-transition"; | |
const DURATION = 500; | |
const TRANSFORM = "transform"; | |
const MOVED_DOWN = "translateY(100%)"; | |
const NOT_MOVED = "translateY(0)"; | |
const ZINDEX = "z-index"; | |
const OPACITY = "opacity"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<card (click)="clicked()"> | |
<card-content> | |
<card-title [ngStyle]="{'font-size': fontsize}">{{itemDetails.name}}</ion-card-title> | |
<icon [svgIcon]="itemDetails.icon" [style.height.px]="iconWidthHeight" | |
[style.width.px]="iconWidthHeight" ></icon> | |
</card-content> | |
</card> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg viewBox="0 0 500 500" preserveAspectRatio="xMinYMin meet"> | |
<defs xmlns="http://www.w3.org/2000/svg"> | |
<filter id="dropshadow" height="130%"> | |
<feGaussianBlur in="SourceAlpha" stdDeviation="3" /> | |
<feOffset dx="2" dy="2" result="offsetblur" /> | |
<feComponentTransfer xmlns="http://www.w3.org/2000/svg"> | |
<feFuncA type="linear" slope="0.4" /> | |
</feComponentTransfer> | |
<feMerge> | |
<feMergeNode/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myModule = angular.module(...); | |
myModule.directive('directiveName', function (injectables) { | |
return { | |
restrict: 'A', | |
template: '<div></div>', | |
templateUrl: 'directive.html', | |
replace: false, | |
priority: 0, | |
transclude: false, | |
scope: false, |