0

I create a .html in my angular application

.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
    <div>
        <p>TEST</p>
    </div>
</body>
</html>

I want to know if it's possible in an angular component to show in a div for example the content of the .html file

It will look like this :

<h1>Manual</h1>
<div>
    // HTML CONTENT
</div>
3
  • yes its possible but sounds like you're trying to check 'working with angular' while actually doing non angular code . you sure that's smart ? were missing the context here. Commented Aug 21, 2019 at 14:13
  • @Stavm All my project is in angular but I create a Manual with BlueGriffon so I have a .html file and I wanted to know if I can use it or if I have to do it again with angular Commented Aug 21, 2019 at 14:18
  • I think your question is about using the very basic angular features like Master/Detail components. Check more about it here: angular.io/tutorial/toh-pt3. Like the answer to this question, you will need to create the component to put there your html. Commented Aug 21, 2019 at 15:41

1 Answer 1

2

You can if they are different components.

With Angular, at the top of a .ts file of a component (say example-one), there will be a section looking like this:

@Component({
  selector: 'app-example-one',
  templateUrl: './example-one.component.html',
  styleUrls: ['./example-one.component.css']
})

To insert the HTML content of example-one into another html file, you would add it like any other element. In your case,

<h1>Manual</h1>
<div>
    <app-example-one></app-example-one>
</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.