Skip to content

Is moduleId a reserved Keyword in Angular? #15286

Closed

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.

Activity

  1. DzmitryShylovich commented on Mar 19, 2017

    @DzmitryShylovich
    Contributor
  2. laclac777 commented on Mar 19, 2017

    @laclac777

    The issue can reproduced with a webpack CLI project.

  3. DzmitryShylovich commented on Mar 19, 2017

    @DzmitryShylovich
    Contributor

    ok, re-open it on https://github.com/angular/angular-cli/issues
    because I can't reproduce it neither in plunkr nor in https://github.com/AngularClass/angular2-webpack-starter

  4. rahulrsingh09 commented on Mar 19, 2017

    @rahulrsingh09
    Author

    @DzmitryShylovich I am using AngularCli and this is not working over there,Not sure how its working for u

  5. DzmitryShylovich commented on Mar 19, 2017

    @DzmitryShylovich
    Contributor

    Not sure how its working for u

    it's working for me because I don't use CLI.
    The OP question is Is moduleId a reserved Keyword in Angular?. No, it's not a reversed keyword. If it doesn't work in CLI this means it's a CLI issue. https://github.com/angular/angular-cli/issues - CLI repo

  6. rahulrsingh09 commented on Mar 19, 2017

    @rahulrsingh09
    Author

    @DzmitryShylovich Shall i post this in Cli issues ? can i get a answer there

  7. DzmitryShylovich commented on Mar 19, 2017

    @DzmitryShylovich
    Contributor

    @rahulrsingh09 yeas, please, open this in cli repo. thanks

  8. IgorMinar commented on Mar 20, 2017

    @IgorMinar
    Contributor

    resolving since this is being handled within the cli project

  9. angular-automatic-lock-bot commented on Sep 11, 2019

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions