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
• [title](url) |
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 CDK Drag Utils source: https://github.com/angular/components/blob/master/src/cdk/drag-drop/drag-utils.ts | |
/** | |
* Moves an item one index in an array to another. | |
* @param arraySource Array in which to move the item. | |
* @param fromIndex Starting index of the item. | |
* @param toIndex Index to which the item should be moved. | |
*/ | |
export function moveItemInArray<T = any>(arraySource: T[], fromIndex: number, toIndex: number): T[] { | |
const array = JSON.parse(JSON.stringify(arraySource)); |
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
import { Component, OnInit } from '@angular/core'; | |
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | |
@Component({ | |
selector: 'app-demo', | |
template: ` | |
<form [formGroup]="form"> | |
<input type="text" formControlName="yourname"> | |
<app-stars formControlName="stars"></app-stars> | |
</form> |
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
import { AfterViewInit, Component, ElementRef, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core'; | |
import { HighChartService } from './highchart.service'; | |
@Component({ | |
selector: 'fb-highchart', | |
template: '<div *ngIf="config"></div>', | |
providers: [HighChartService] | |
}) | |
export class HighChartComponent implements OnChanges, AfterViewInit { | |
@Input() config: any; |
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 MyClass { | |
text = 'Mario'; | |
constructor() { | |
setTimeout(() => console.log(this.text), 1000); | |
} | |
} | |
var a = new MyClass(); |
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
'use strict'; | |
angular.module('myHelloModule', []) | |
.component('helloPanel', { | |
bindings: { | |
title: '@', | |
body: '<' | |
}, | |
templateUrl: 'app/hello-panel.tpl.html', | |
controller: 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
import CircleButton from './CircleButton'; | |
// Init stage | |
const stage = new createjs.Stage("demo"); | |
// Button black | |
const btn = new CircleButton('Hi'); | |
btn.x = 50; btn.y = 50; | |
stage.addChild(btn); |
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
import MyButton from './MyButton.js'; | |
const stage = new createjs.Stage("demo"); | |
const btn = new MyButton('red'); | |
stage.addChild(btn); | |
btn.x = 100; | |
btn.y = 100; | |
stage.update(); |
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> | |
<meta charset="utf-8"> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> |
NewerOlder