question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Material Sidenav schematic creates build errors

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

ng build should work

What is the current behavior?

ng build fails

ERROR in src/app/navigation/navigation.component.ts(13,3): error TS2322: Type ‘Observable<boolean>’ is not assignable to type ‘Observable<BreakpointState>’. Type ‘boolean’ is not assignable to type ‘BreakpointState’.

What are the steps to reproduce?

Step 1 Created a new angular project e.g.: ng new angular6test

Step 2 Add matrerial and generate schematic

ng add @angular/material ng generate @angular/material:material-nav --name=navigation

I have added the navigation component in my app.component.html

e.g.

 <navigation>
</navigation>

Step 3 ng build

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

This is my package.json

{ “name”: “angular6test”, “version”: “0.0.0”, “scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e” }, “private”: true, “dependencies”: { “@angular/animations”: “^6.0.2”, “@angular/cdk”: “^6.1.0”, “@angular/common”: “^6.0.2”, “@angular/compiler”: “^6.0.2”, “@angular/core”: “^6.0.2”, “@angular/forms”: “^6.0.2”, “@angular/http”: “^6.0.2”, “@angular/material”: “^6.1.0”, “@angular/platform-browser”: “^6.0.2”, “@angular/platform-browser-dynamic”: “^6.0.2”, “@angular/router”: “^6.0.2”, “core-js”: “^2.5.4”, “hammerjs”: “^2.0.8”, “rxjs”: “^6.0.0”, “zone.js”: “^0.8.26” }, “devDependencies”: { “@angular/compiler-cli”: “^6.0.2”, “@angular-devkit/build-angular”: “~0.6.3”, “typescript”: “~2.7.2”, “@angular/cli”: “~6.0.3”, “@angular/language-service”: “^6.0.2”, “@types/jasmine”: “~2.8.6”, “@types/jasminewd2”: “~2.0.3”, “@types/node”: “~8.9.4”, “codelyzer”: “~4.2.1”, “jasmine-core”: “~2.99.1”, “jasmine-spec-reporter”: “~4.2.1”, “karma”: “~1.7.1”, “karma-chrome-launcher”: “~2.2.0”, “karma-coverage-istanbul-reporter”: “~1.4.2”, “karma-jasmine”: “~1.1.1”, “karma-jasmine-html-reporter”: “^0.2.2”, “protractor”: “~5.3.0”, “ts-node”: “~5.0.1”, “tslint”: “~5.9.1” } }

Is there anything else we should know?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
chrisvfabiocommented, May 22, 2018

Yeah, the isHandset$ return type was changed. The following works for me:

isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
    .pipe(
      map(result => result.matches)
    );

isHandset$: Observable<BreakpointState> => isHandset$: Observable<boolean>

0reactions
angular-automatic-lock-bot[bot]commented, Sep 9, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Material Schematics generated code - Stack Overflow
The Angular CDK has a layout package with services that make it easy to detect viewport sizes and matches against media queries.
Read more >
Schematics - Angular Material
The table schematic will create a component that renders an Angular Material <table> which has been pre-configured with a datasource for sorting and...
Read more >
Quick UI using Angular Material Schematics [#2] - YouTube
Using Material Schematics, we can create different components easily. ... In the side nav, we will keep two options 'Home' and 'Search'.
Read more >
Angular Error NG8001: is not a known element ... - YouTube
https://readdy.net/Notes/Details/1827Angular Error NG8001: 'mat-progress-spinner' is not a known element:Angular Error is an Angular ...
Read more >
Use Angular Schematics to Simplify Your Life | Okta Developer
Make sure you are in an Angular project directory before you run this command. Also, make sure your project is checked into source...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found