This file contains 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
/** | |
* Checks through a list of fileURI's and compares the | |
* file extensions of those fileURI's to the acceptedPhotoTypes | |
* @param files array of objects with a source property, this property is the fileURI location of the photo | |
* @param acceptedTypes an array of accepted photo types. EG '.jpeg' | |
* @returns {boolean} | |
*/ | |
function validateFileExtensions(files, acceptedTypes) { | |
var passed = false; |
This file contains 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
function Person(name){ | |
this.name = name; | |
} | |
module.exports = Person; |
This file contains 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
function clean (array,deleteValue) { | |
for (var i = 0; i < array.length; i++) { | |
if (array[i] == deleteValue) { | |
array.splice(i, 1); | |
i--; | |
} | |
} | |
return array; | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script> | |
<script src="script.js"></script> | |
</head> | |
<body ng-app="init"> |
This file contains 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
angular.module("test", []) | |
.controller("testCtrl", function($scope) { | |
$scope.value = ""; | |
}) | |
.directive('custSrc', function() { | |
return { | |
restrict: "A", | |
scope: { | |
value: "=custSrc" | |
}, |
This file contains 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
class Person{ | |
private Name: string; | |
constructor(public Age: number, name: string){ | |
this.Name = name; | |
} | |
Older(){ | |
this.Age ++; | |
} | |
} |
This file contains 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
module PowerLine { | |
export interface IValidatable { | |
Validate: (model: any, info: any) => boolean; | |
} | |
export class Validator implements IValidatable { | |
public Validate(info: any) { | |
var results = []; | |
for (var key in info) { | |
if(key !== "constructor" && typeof info[key] !== "function"){ |
This file contains 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
function getPage(page, list, amountPerPage) { | |
if (page > 0) { | |
var start = 0; | |
if (page !== 1) { | |
start = page; | |
start = start -1; | |
} | |
if (list.length > 0) { | |
return angular.copy(list).splice((start * amountPerPage), amountPerPage); | |
} |
This file contains 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
function hoist() { | |
for(var i = 0; i < 10 i++){ | |
var test = "Test"; | |
} | |
console.log(test); | |
} | |
function hoist2() { | |
var test; |
This file contains 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 Rule = (function () { | |
function Rule(property, subValidator, instance) { | |
this.property = property; | |
this.subValidator = subValidator; | |
this.instance = instance; | |
} | |
return Rule; | |
})(); | |
var SubValidator = (function () { |
OlderNewer