#How to combine two components?
16 messages · Page 1 of 1 (latest)
Are you using standalone components?
Add the component you want to use in the html to in import section of the component that is going to use it.
Yup
<todo-list-item></todo-list-item> is the selector and I just get the url to it on the frontend - ./todo-list-item.component.html
not the actual component
I'm not sure what you mean
i have imported it in the imports of the component where I want it to be. Now I go to the app.component.html file and use it as tags specifying the selectos - <todo-list-item></todo-list-item> but instead of the actual component html markup I get just the url to it on the frontend as a string
Never seen that. What does the @Component decorator look like for that component?
import { Component } from "@angular/core";
@Component({
standalone: true,
selector: 'todo-list-item',
template: './todo-list-item.component.html',
styles: './todo-list-item.component.css',
})
export class TodoListItem {
}
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, TodoListItem],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
})
export class AppComponent {
title = 'day1Angular';
}
ok ok its not style its styleUrl and same for template OMG