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
export function Auth(data){ | |
return function (target: Function) { | |
Object.defineProperty(target.prototype, "ionViewCanEnter", { | |
value: authFunction | |
}); | |
}; | |
function authFunction(){ | |
//Here you can do your custom validation, it must return a boolean or a Promise | |
return false; |
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, ElementRef, Renderer, Input, OnInit } from "@angular/core"; | |
@Directive({ | |
selector: "[typewritter]" | |
}) | |
export class TypewritterDirective implements OnInit{ | |
@Input("quotes") quotes : string[] = []; | |
private writtingSpeed : number = 225; | |
private deletingSpeed : number = 80; |
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
.directive("digitLimit", function(){ | |
return { | |
require: "^form", | |
restrict: "A", | |
link: function(scope, element, attrs, ctrl){ | |
var max = attrs.digitLimit; | |
element.bind("keypress keydown", function(e){ | |
if(e.type == "keypress"){ | |
var currentValue = element.val(); |
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
/* | |
<input type='number' digit-limit="4" /> | |
*/ | |
.directive("digitLimit", function(){ | |
return { | |
restrict: "A", | |
link: function(scope, element, attrs){ | |
var max = attrs.digitLimit; | |
element.bind("keydown", function(e){ |
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
/* | |
<input type='number' min-digits='4' /> | |
*/ | |
.directive("minDigits", function () { | |
return { | |
require: "ngModel", | |
link: function (scope, element, attrs, ctrl) { | |
var min = attrs.minDigits; | |
element.bind("keyup", function () { |
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
@-webkit-keyframes echo { | |
0% { | |
padding: 0; | |
margin: 0; | |
opacity: 1; | |
} | |
100% { | |
padding: 50px; | |
margin: -50px; |
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
[{"country":"Afghanistan","code":"93","iso":"AF"}, | |
{"country":"Albania","code":"355","iso":"AL"}, | |
{"country":"Algeria","code":"213","iso":"DZ"}, | |
{"country":"American Samoa","code":"1-684","iso":"AS"}, | |
{"country":"Andorra","code":"376","iso":"AD"}, | |
{"country":"Angola","code":"244","iso":"AO"}, | |
{"country":"Anguilla","code":"1-264","iso":"AI"}, | |
{"country":"Antarctica","code":"672","iso":"AQ"}, | |
{"country":"Antigua and Barbuda","code":"1-268","iso":"AG"}, | |
{"country":"Argentina","code":"54","iso":"AR"}, |