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.

mat- prefix error

See original GitHub issue

Hello, I looked everywhere for an answer but every fix didn’t work. I have done the fix to convert md to mat and I added:

MATERIAL_COMPATIBILITY_MODE, useValue: true

and NoConflictStyleCompatibilityMode,

Bug, feature request, or proposal:

BUG

What is the expected behavior?

What is the current behavior?

ERROR Error: The “mat-” prefix cannot be used in ng-material v1 compatibility mode. It was used on an “mat-menu” element. at getMdCompatibilityInvalidPrefixError (compatibility.js:21) at new MatPrefixRejector (compatibility.js:32) at createClass (core.es5.js:10936) at createDirectiveInstance (core.es5.js:10764) at createViewNodes (core.es5.js:12212) at createEmbeddedView (core.es5.js:12095) at callWithDebugContext (core.es5.js:13493) at Object.debugCreateEmbeddedView [as createEmbeddedView] (core.es5.js:12839) at TemplateRef_.webpackJsonp…/…/…/core/@angular/core.es5.js.TemplateRef_.createEmbeddedView (core.es5.js:10279) at ViewContainerRef_.webpackJsonp…/…/…/core/@angular/core.es5.js.ViewContainerRef_.createEmbeddedView (core.es5.js:10056)

What are the steps to reproduce?

<mat-menu #notificationsMenu="matMenu" [overlapTrigger]="false">

                                      <div td-menu-header class="mat-subhead">Notifications</div>
                                  <mat-nav-list dense>
                                      <ng-template let-last="last" ngFor [ngForOf]="[0]">
                                          <div  *ngFor="let i of mydemands">
                                          <a mat-list-item *ngIf="i.haylpers.length != 0">
                                              <mat-icon mat-list-avatar>today</mat-icon>
                                              <h4 matLine><span class="text-wrap" ><span class="highlight"> <a routerLink="/profile" routerLinkActive="active"><i class="mdi-action-add-shopping-cart"></i> {{i.title}}</a></span><span *ngIf="i.haylpers.length > 1" class="new badge" data-badge-caption="réponses">{{i.haylpers.length}}</span> <span *ngIf="i.haylpers.length === 1" class="new badge" data-badge-caption="réponse">{{i.haylpers.length}}</span></span></h4>
                                              <p matLine> <time class="media-meta" datetime="2015-06-12">{{i.date | date:'h:mma'}}</time></p>
                                          </a>
                                          </div>
                                          <mat-divider></mat-divider>
                                      </ng-template>
                                  </mat-nav-list>
                                      <button mat-button color="accent" td-menu-footer>
                                          See All Notifications
                                      </button>
                              
                              </mat-menu>

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

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

Angular 4.4.4 Angular material 2.0.0-beta.12

Any idea?

Regards,

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tapas4javacommented, Oct 17, 2017

@vicochips Still facing issue?? Try to delete package-lock.json file and do a fresh npm i

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

mat-prefix to work on the input not the label - Stack Overflow
If I use matprefix it puts the dollar sign infront of the label not the input field. Can anyone suggest a way to...
Read more >
The "mat-" prefix cannot be used in ng-material v1 ... - GitHub
Trying to integrate covalent's aitocomplete into a project using SystemJS and getting this: ERROR Error: Uncaught (in promise): Error: The "mat- ...
Read more >
Form field - Angular Material
Error messages can be shown under the form field underline by adding mat-error elements inside the form field. Errors are hidden initially and...
Read more >
Form field with prefix &amp; suffix - StackBlitz
<div class="example-container"> · <mat-form-field> · <input matInput placeholder="Enter your · password" [type]="hide ? 'password' : · 'text'"> · <button mat-icon- ...
Read more >
An Introduction to Angular Material Form-Fields - Medium
Adding a Prefix and Suffix to a component. Adding Hint labels. Adding Error Messages. Using themes. What is a Material Form-Field? A mat-form ......
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