Skip to content

CLI do not think about new property of interface #5976

Closed
@MISTERSOFT

Description

@MISTERSOFT

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0
node: 6.9.1
os: win32 x64
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/core: 4.0.2
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2
@angular/router: 4.0.2
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.2

Repro steps.

  1. ng new simple_project
  2. ng serve
  3. ng g service TestService
  4. Create an exportable interface in an other file : ITest with a property first
  5. Implement the ITest interface in TestService
  6. Inject the TestService into the AppComponent constructor
  7. Import the interface created into the AppComponent
  8. Create a new instance of the TestService and store the instance into a variable of type ITest (this is useless but into an other project I'm using interface to use some services)
  9. Make a console.log of the property first from the variable of type ITest (that will work)
  10. Save all changes and wait the compilation
  11. Create a new property into the ITest interface (e.g: second)
  12. In the AppComponent, make a console.log of the property second from the variable of type ITest
  13. Save changes
  14. Compilation error appears

The log given by the failure.

ERROR in F:/Projets/Web/simple_project/src/app/app.component.ts (60,19): Property 'second' does not exist on type 'ITest'.

Mention any other details that might be useful.

If we shutdown the CLI and restart with an ng serve that will compile fine and the error disappears.

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