Angular App Compiled successfully, getting error my-app did not match any elements, could you guide me what could be wrong?

Praveen Saboji

enter image description here

enter image description here

routing.module.ts :

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; // CLI imports router
import { BoardComponent } from './board/board.component';
import { ViewlistComponent } from './viewlist/viewlist.component';

const routes: Routes = [
  { path: '', component: ViewlistComponent },

  { path: 'View-List', component: ViewlistComponent },
]; // sets up routes constant where you define your routes

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
})
export class RoutingModule {}

app.component.html :

<div class="navbar">
  <h1 class="brand">Project Manager / <small>Exemple</small></h1>
  <span>&nbsp;</span>
  <a class="main-btn" routerLink="/View-List" routerLinkActive="active"
    >button2</a
  >
</div>

<div class="interface"></div>

<!-- <app-board [board]=board></app-board>
  <app-info></app-info> -->
<router-outlet></router-outlet>

As you see I'm trying to load my app, it's compiled successfully, but it's giving error when I load the app in browser. I'm trying to understand what I have done wrong in here. can anyone tell me the reason for this error ?

Suneet Bansal

It seems that index.html is missing <my-app> element. Could you check index.html and add below in <body>:

 <my-app></my-app>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error: "app" did not match any elements

Webpack - The selector "my-app" did not match any elements

Angular 2 EXCEPTION: The selector "app" did not match any elements

Using Angular custom web component throws error: The selector "app-root" did not match any elements

Angular2 - Error: The selector "app-root" did not match any elements

Getting 'Could Not Be Found' Error re: Custom Pipe in Angular 2 App

detox app could not be found, did you run './gradlew assembleAndroidTest'?

What could influence the visibility of my app on the store?

Could you tell me what's wrong with the following Subscription example?

could you please let me know what is wrong with this code?

Not getting any error in this program but my required output is not coming. Could someone help me?

Angular 4 RC.4 & .net core The selector "app" did not match any elements

Angular2 CLI build EXCEPTION : The selector "app-root" did not match any elements

What could be wrong with my function?

Getting "The AndroidManifest.xml of the uploaded APK could not be parsed. Was it compiled properly?" error after enabling Google App Signing

Error in angular (fails to detect layout) The selector "app-layout" did not match any element

Getting this message - Warning: Error in as.tbl: could not find function "as.tbl" while publishing my shiny app

Updating Electron app and getting error that Electron could not be found

Flutter Error "Could not navigate to inital root in my app"

"getActivePinia() was called but there was no active Pinia. Did you forget to install pinia?" error in console, but the app compiles successfully

Could you help me Explain what this means?

I'm getting an **NumPyClient.fit did not return a tuple with 3 elements.** error when I run client.py file. What could be the problem?

What could be wrong with my obj-parser?

Angular app error when running npm install - Could not resolve dependency

Why there is an error "The requested URL could not be retrieved" with angular app?

Error with Angular ag-grid: "Could not find component class XXX, did you forget to configure this component"

Is there any way a user could save images to my app from safari as they can do with the native camera roll app?

Flask app getting error of "could not locate flask application. .....FLASK_APP environment variable" for Flask Migrate

error: reference to overloaded function could not be resolved; did you mean to call it?