Skip to content

Is moduleId a reserved Keyword in Angular? #5509

@rahulrsingh09

Description

@rahulrsingh09

export class AppComponent {
title = 'app works!';

constructor() {

  let test1 = {
        id: 'test',
        moduleId1: 'moduleId1',
        moduleId: 'IsThisReserverdWord',
        moduleId2: 'moduleId2'
    };

  console.log(test1.moduleId);

  let test2 = {
        moduleId: 'moduleId3',
    };

}
It is very strange that the console log part is never hit and there is no exception. By removing the moduleId: 'IsThisReserverdWord' property it is all fine.

Is moduleid reserved key word as when i try and print the moduleId without having any other property in test it gives undefined and also if i try and print moduleId2 in the above test object it throws error test1 is not defined.

Issue was previously opened in Angular github link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions