Closed
Labels
Description
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.
Activity
filipesilva commentedon Mar 19, 2017
It is reserved... of sorts. It's a compromise we made to seamlessly support a lot of existing documentation that does use
moduleId: module.id.So we remove it when we parse app code. We know this isn't ideal.
fix(@ngtools/webpack): only remove moduleId in decorators
fix(@ngtools/webpack): only remove moduleId in decorators
fix(@ngtools/webpack): only remove moduleId in decorators
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
fix(@ngtools/webpack): only remove moduleId in decorators