Skip to content

Instantly share code, notes, and snippets.

@chaosmonster
chaosmonster / my-chart.component.ts
Created May 24, 2017 07:36
ng2-charts unpassed options
import {Component} from '@angular/core';
@Component({
selector: 'app-my-chart',
template: ` <div>
<canvas baseChart [datasets]="chartData" [labels]="chartLabels" [options]="chartOptions" [legend]="chartLegend"
[chartType]="chartType"></canvas>
</div>`
})
export class MyChartComponent {
public chartOptions: any = {
export interface PizzaContext {
toppings?: string[];
size?: string;
}
export class DefaultPizzaContext implements PizzaContext {
toppings: string[];
size: string;
constructor(form: PizzaContext = null) {
@chaosmonster
chaosmonster / example.md
Last active November 12, 2016 09:54
Compare Regex syntax angular 1.5 and angular2 template syntax

In Angular1

angular.module('foo', []).directive('btnGroup'['$parse', function($parse) {
    return {
		restrict	: 'E',
		replace		: true,
		scope		: true,
        template	: '',
		link		: function(scope, elem, attrs) {