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.

'md-option' is not a known element

See original GitHub issue

Bug, feature request, or proposal:

Bug (or wrong usage?)

What is the expected behavior?

Options should be displayed within the select element.

What is the current behavior?

The whole application does not render

What are the steps to reproduce?

Tried to reproduce it with a plunkr, was happy when i edited your template and saw i got the same error. after opening and verifying it in a new private window the error disappeared. So i assumed it could be a client cache problem, but after retrying with different browsers i still get not managed this problem.

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

I am using Material 2.0.0-alpha.11-3 with Angular 2.2.4

Is there anything else we should know?

I am using Angular-CLI

Unhandled Promise rejection: Template parse errors:
'md-option' is not a known element:
1. If 'md-option' is an Angular component, then verify that it is part of this module.
2. If 'md-option' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("h2>User hinzufügen</h2>
					<md-select [(ngModel)]="aUserId" name="user" placeholder="User">
						[ERROR ->]<md-option *ngFor="let item of aUser" value="5">{{item.firstname}} {{item.lastname}}</md-option>
					<"): MyComponent@17:6
TemplateParser</TemplateParser.prototype.parse@http://localhost:4200/vendor.bundle.js:18368:19 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileTemplate@http://localhost:4200/vendor.bundle.js:40389:30 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileComponents/<@http://localhost:4200/vendor.bundle.js:40309:56 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileComponents@http://localhost:4200/vendor.bundle.js:40309:9 [<root>]
RuntimeCompiler</RuntimeCompiler.prototype._compileModuleAndComponents/createResult@http://localhost:4200/vendor.bundle.js:40205:13 [<root>]
Zone$1</Zone</Zone.prototype.run@http://localhost:4200/vendor.bundle.js:95823:24 [<root> => <root>]
scheduleResolveOrReject/<@http://localhost:4200/vendor.bundle.js:96219:52 [<root>]
Zone$1</Zone</Zone.prototype.runTask@http://localhost:4200/vendor.bundle.js:95861:28 [<root> => <root>]
drainMicroTaskQueue@http://localhost:4200/vendor.bundle.js:96115:25 [<root>]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
bijukkuttycommented, Jul 19, 2017

Started working after adding import { MaterialModule } from ‘@angular/material’; import { MdSelectModule } from ‘@angular/material’;

and importing it to array like below on the same module as where the form is. If added to app.module.ts it was still giving error

imports: [ BrowserModule, FormsModule, HttpModule, MaterialModule, MdSelectModule ],

9reactions
tariknzcommented, Dec 12, 2016

I had to import the MdSelectModule separate to the MaterialModule to get it to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Material component not working: 'mat-option' is not a ...
Uncaught Error: Template parse errors: 'mat-option' is not a known element: // ... I think the error comes from app.module.ts : import { ......
Read more >
'ng-option' is not a known element: - You.com | The AI Search ...
Unhandled Promise rejection: Template parse errors: 'md-option' is not a known element: 1. If 'md-option' is an Angular component, then verify that it...
Read more >
angular material grid example
ERROR in : 'mat-grid-tile' is not a known element: 1. ... If 'md-option' is an Angular component, then verify that it is part...
Read more >
Directives > mdSelect - AngularJS Material
Parameter Type Description * ng‑model expression expression Assignable angular expression to data‑bind to. placeholder string string Placeholder hint text.
Read more >
angular/material2 - Gitter
ngFor is also fine? _. Can't bind to 'ngValue' since it isn't a known property of 'md-option' ...
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