類裝飾
裝飾NgModule
@NgModule({
providers?: Provider[]
declarations?: Array<Type<any> | any[]>
imports?: Array<Type<any> | ModuleWithProviders | any[]>
exports?: Array<Type<any> | any[]>
entryComponents?: Array<Type<any> | any[]>
bootstrap?: Array<Type<any> | any[]>
schemas?: Array<SchemaMetadata | any[]>
id?: string
})
複製代碼
裝飾Component
@Component({
changeDetection?: ChangeDetectionStrategy
viewProviders?: Provider[]
moduleId?: string
templateUrl?: string
template?: string
styleUrls?: string[]
styles?: string[]
animations?: any[]
encapsulation?: ViewEncapsulation
interpolation?: [string, string]
entryComponents?: Array<Type<any> | any[]>
preserveWhitespaces?: boolean
selector?: string
inputs?: string[]
outputs?: string[]
host?: {...}
providers?: Provider[]
exportAs?: string
queries?: {...}
})
複製代碼
裝飾Directive
@Directive({
selector?: string
inputs?: string[]
outputs?: string[]
host?: {...}
providers?: Provider[]
exportAs?: string
queries?: {...}
})
複製代碼
裝飾Pipe
@Pipe({
name: string
pure?: boolean
})
複製代碼
裝飾 Injectable
@Injectable({
providedIn?: Type<any> | 'root' | null
factory: () => any
})
複製代碼
屬性裝飾
@Attribute({
attributeName?: string
})
複製代碼
@HostBinding({
hostPropertyName?: string
})
複製代碼
@HostListener({
eventName?: string
args?: string[]
})
複製代碼
@Input({
bindingPropertyName?: string
})
複製代碼
@Output({
bindingPropertyName?: string
})
複製代碼
@ContentChild()
複製代碼
@ContentChildren()
複製代碼
@ViewChild()
複製代碼
@ViewChildren()
複製代碼
參數裝飾
@Host()
複製代碼
@Optional()
複製代碼
@Self()
複製代碼
@SkipSelf()
複製代碼
@Inject({
token: any
})
複製代碼