angular-docgen
Version:
A toolkit to extract information from Angular components for documentation generation.
63 lines (50 loc) • 987 B
Plain Text
import { Component, Input, Output, EventEmitter } from "@angular/core";
import Superman from "heroes/superman";
/**
* Sample Component
*/
@Component({
selector: "my-button",
templateUrl: "template.html",
styleUrls: ["styles1.css", "styles2.css"]
})
export default class SampleComponent {
value: string = false;
/**
* boolean type
* with second line
*/
@Input() disabled: boolean = false;
/**
* string type
*/
@Input() name: string = "test";
/**
* number type
*/
@Input() count: number = 1;
/**
* string literal types
*/
@Input() type: "primary" | "secondary" = "primary";
/**
* numeric literal types
*/
@Input() type: 1 | 2 | 3 = 1;
/**
* variant types
*/
@Input() what: number | string = "test";
/**
* no default
*/
@Input() empty: string;
/**
* non primitive
*/
@Input() hero: Hero = Superman;
/**
* output property
*/
@Output() onClick = new EventEmitter<boolean>();
}