fix(core): `Attribute` decorator `attributeName` is mandatory (#38131)

`Attribute` decorator has defined `attributeName` as optional but actually its
 mandatory and compiler throws an error if `attributeName` is undefined. Made
`attributeName` mandatory in the `Attribute` decorator to reflect this functionality

Fixes #32658

PR Close #38131
This commit is contained in:
Ajit Singh 2020-07-18 18:35:28 +05:30 committed by Misko Hevery
parent b4449e35bf
commit af80bdb470
3 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ export declare function asNativeElements(debugEls: DebugElement[]): any;
export declare function assertPlatform(requiredToken: any): PlatformRef;
export declare interface Attribute {
attributeName?: string;
attributeName: string;
}
export declare const Attribute: AttributeDecorator;

View File

@ -22,10 +22,10 @@ export const createInjectionToken = makeMetadataFactory<object>(
'InjectionToken', (desc: string) => ({_desc: desc, ɵprov: undefined}));
export interface Attribute {
attributeName?: string;
attributeName: string;
}
export const createAttribute =
makeMetadataFactory<Attribute>('Attribute', (attributeName?: string) => ({attributeName}));
makeMetadataFactory<Attribute>('Attribute', (attributeName: string) => ({attributeName}));
export interface Query {
descendants: boolean;

View File

@ -271,7 +271,7 @@ export interface Attribute {
/**
* The name of the attribute whose value can be injected.
*/
attributeName?: string;
attributeName: string;
}
/**