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
/** | |
* Classes and Inheritance | |
* Code Example from http://www.es6fiddle.net/ | |
*/ | |
class Polygon { | |
constructor(height, width) { //class constructor | |
this.name = 'Polygon'; | |
this.height = height; | |
this.width = width; | |
} |
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
'use strict'; | |
/** | |
* Authentication with token and email for every server request. (Sets HTTP headers) | |
* | |
* This interceptor shows the error from the server (i18n key). | |
* Also sets global error variable if the request fails and redirects the user to '/' when he is not authorized. | |
* @see http://engineering.talis.com/articles/client-side-error-logging/ | |
*/ | |
app.factory('authInterceptor', function ($rootScope, $q, $cookies, $location, $timeout) { |
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
/** | |
* Angular 1.2 | |
* Helper method for Signup and Update. Checks if email or username of user exists per GET request. | |
* Sets custom validation: 'exists' to true or false. | |
* @example | |
* <input type="email" name="email" ng-model="user.email" ng-change="checkIfExists(form.email)" /> | |
*/ | |
var timeout = false; | |
$scope.checkIfExists = function(input) { | |
if(!input.$viewValue) { return; } |
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
/** | |
* Handles form errors from server. | |
*/ | |
app.factory('formErrors', function () { | |
return { | |
/** | |
* Creates $error.errorKey (String) and sets validity | |
* for every failing model validation received from the server. | |
* E.g. 'form.message.$error.errorKey' can be accessed in the view. |
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
<!-- | |
Uncaught Error: [$location:nobase] | |
https://docs.angularjs.org/error/$location/nobase | |
--> | |
<head> | |
<base href="/"> | |
</head> |
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
$pieSize: 18px; | |
.pie-wrap { // own class | |
float: left; | |
svg { | |
display: inline-block; | |
width: $pieSize; | |
height: $pieSize; | |
margin: 4px; |
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
<nvd3 options="pieOptions" data="pieData"></nvd3> |
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
<nvd3-pie-chart id="{{id}}" | |
data="pieData" | |
width="80" | |
height="80" | |
x="xFunction()" | |
y="yFunction()"> | |
</nvd3-pie-chart> |
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
<canvas tc-chartjs-pie chart-data="pieData" chart-options="{segmentShowStroke: false}" width="25" height="25"></canvas> |