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:
parent
63894062d4
commit
d3999d904a
2
goldens/public-api/core/core.d.ts
vendored
2
goldens/public-api/core/core.d.ts
vendored
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -271,7 +271,7 @@ export interface Attribute {
|
||||
/**
|
||||
* The name of the attribute whose value can be injected.
|
||||
*/
|
||||
attributeName?: string;
|
||||
attributeName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user