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
{ | |
"directory": "public/bower_components" | |
} |
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
{ | |
"directory": "public/bower_components" | |
} |
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
if (!JSON.tryParse) | |
{ | |
JSON.tryParse = function (str) { | |
var successState=1, errorState = 2, result, errorResult, | |
promise = { | |
then: function(successCallback, errorCallback) | |
{ | |
if (this.state === successState) |
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 getModule(moduleName){ | |
console.log('Getting module ' + moduleName); | |
var module = angular.module(moduleName); | |
if (!module) { | |
consoile.error('Module ' + moduleName + ' was not found'); | |
return; | |
} | |
for (var i = 0; i < module.requires.length; i++){ | |
getModule(module.requires[i]); | |
} |
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
const MILLISECONDS_IN_A_SECOND: number = 1000; | |
const SECONDS_IN_A_MINUTE: number = 60; | |
const MINUTES_IN_AN_HOUR: number = 60; | |
const HOURS_IN_A_DAY: number = 24; | |
const DAYS_IN_A_WEEK: number = 7; | |
const MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE; | |
const MILLISECONDS_IN_AN_HOUR = MILLISECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR; | |
const MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_AN_HOUR * HOURS_IN_A_DAY; | |
const MILLISECONDS_IN_A_WEEK = MILLISECONDS_IN_A_DAY * DAYS_IN_A_WEEK; |
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
if (window.fetch) { | |
const origFetch = fetch; | |
fetch = function(url, options) { | |
if (!options) { | |
options = {}; | |
} | |
// Adding the creadentials option | |
options.credentials = 'include'; |
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
getFragments(url) { | |
if (url.endsWith('/')) { | |
url = url.substring(0, url.length - 1); | |
} | |
if (url.startsWith('/')) { | |
url = url.substring(1); | |
} | |
return url === '/' ? [''] : url.split('/'); |
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
buildRoutesTreeFromFragments(urlFragments, routes) { | |
if (!routes.filter) { | |
throw new Error('Routes should be an array'); | |
} | |
const candidates = routes.filter(route => this.isRouteSuitable(route, urlFragments)); | |
if (candidates.length === 0) { | |
return null; | |
} else if (candidates.length === 1) { | |
return this.buildRouteObject(candidates[0], urlFragments); | |
} else { |
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
isRouteSuitable(route, urlFragments) { | |
const routeURLFragments = this.getFragments(route.path); | |
let result = routeURLFragments.length === urlFragments.length; | |
for (let index = 0; result && index < routeURLFragments.length; index++) { | |
const fragment = routeURLFragments[index]; | |
result = fragment.toLowerCase() === urlFragments[index].toLowerCase() || fragment.startsWith(':'); | |
} | |
return result; | |
} |
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
<a is="self-routing-anchor" href='/path/to/your/target'>Inner content </a> |
OlderNewer