D
D
Darkness2019-06-18 16:31:29
Angular
Darkness, 2019-06-18 16:31:29

How to pass .html file to another html file in angular?

I have html where there is markup, css and .ts file
Question. I took out part of the html from the general markup, now I need to display the piece that I took out into the general html import, how can I do this? I am not familiar with Angular, so I may be asking such a stupid question, I apologize right away!
This is what ts looks like

import { Component, OnInit } from '@angular/core';
import {DialogService} from "ng2-bootstrap-modal";
import {ModalFormComponent} from "../../modal/modal-form/modal-form.component";
import { Inject, PLATFORM_ID } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';

@Component({
    selector: 'app-offer-slider',
    templateUrl: './offer-slider.component.html',
    styleUrls: ['./offer-slider.component.less']
})
export class OfferSliderComponent implements OnInit {

    public renderCarousel = false;

    constructor(private dialogService: DialogService, @Inject(PLATFORM_ID) private platform: any) {}

    ngOnInit() {
        if (isPlatformBrowser(this.platform)) {
            this.renderCarousel = true
        }
    }

    public showFormModal(title) {
        let disposable = this.dialogService.addDialog(ModalFormComponent, {title: title})
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-06-18
@AntonBrock

I didn't find a way to import a template from an html file. Everywhere it is suggested to create and use a component.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question