Angular - Components - Separation of Concerns - Creating Child Component Templates and Classes with Bootstrap #14
Replies: 9 comments
-
aside.component.tsimport { Component, OnInit } from '@angular/core';
interface list
{
value : string;
}
@Component({
selector: 'app-aside',
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.css']
})
export class AsideComponent implements OnInit {
title: string = 'Related';
li : list[] = [{ value: 'Hello world'},{ value: 'Learning bootstrap'}, { value: 'Creating good looking pages'},{ value: 'Responsive design'}];
constructor() { }
ngOnInit(): void {
}
}aside.component.html<div class="container">
<h2 class="text-center">{{ title }}</h2>
<div class="row">
<div class="offset-4 col-4 offset-lg-2 col-lg-8">
<ul>
<li>
<a href="">{{ li[0].value }}</a>
</li>
<li>
<a href="">{{ li[1].value }}</a>
</li>
<li>
<a href="">{{ li[2].value }}</a>
</li>
<li>
<a href="">{{ li[3].value }}</a>
</li>
</ul>
</div>
</div>
</div>footer.component.tsimport { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
footText: string = 'Copyright 2050 by Akash Das. All rights reserved.';
constructor() { }
ngOnInit(): void {
}
}footer.component.html<footer class="container box bg-light mb-2">
<div class="row p-3">
<div class="col-12">© {{ footText }}</div>
</div>
</footer>header.component.tsimport { Component, OnInit } from '@angular/core';
interface list
{
value : string;
}
@Component({
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css']
})
export class ChildComponent implements OnInit {
li : list[] = [{value: 'HOME'},{value: 'ARTICLE'},{value: 'CONTACT'}];
constructor() { }
ngOnInit(): void {
}
}child.component.html<header class="container">
<h1 class="page-header text-center">Header</h1>
<div class="row">
<nav
class="col-12 box navbar navbar-expand-lg navbar-fixed-top navbar-dark bg-info"
>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
>
<span class="navbar-toggler-icon"></span>
</button>
<form class="form-inline d-none d-sm-inline d-lg-none my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
<a class="navbar-brand" href="#0">
<img
src="../../assets/img/logo.png"
alt="navbar-brand"
width="30"
height="30"
/>
Blog Nation
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active">{{ li[0].value }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ li[1].value }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ li[2].value }}</a>
</li>
</ul>
<form class="form-inline d-sm-none d-lg-inline my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
</div>
</nav>
</div>
</header>
|
Beta Was this translation helpful? Give feedback.
-
app.component.html<div class="bg-secondary">
<app-header></app-header>
<app-main></app-main>
<app-footer></app-footer>
</div>header.component.html<header class="container">
<h1 class="page-header text-center">Header</h1>
<div class="row">
<nav
class="col-12 box navbar navbar-expand-lg navbar-fixed-top navbar-dark bg-info"
>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
>
<span class="navbar-toggler-icon"></span>
</button>
<form class="form-inline d-none d-sm-inline d-lg-none my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">
{{ menuOptions[0] }}
</button>
</form>
<a class="navbar-brand" href="#0">
<img
src="../../assets/img/logo.png"
alt="navbar-brand"
width="30"
height="30"
/>
Blog Nation
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active">{{ menuOptions[1] }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ menuOptions[2] }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ menuOptions[3] }}</a>
</li>
</ul>
<form class="form-inline d-sm-none d-lg-inline my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
</div>
</nav>
</div>
</header>header.component.tsimport { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
menuOptions: string[]=["Search","HOME","ARTICLES","CONTACT"]
constructor() { }
ngOnInit(): void {
}
}footer.component.html<footer class="container box bg-light mb-2">
<div class="row p-3">
<div class="col-12">© {{ footerClause }}</div>
</div>
</footer>footer.component.tsimport { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
footerClause: string = " Copyright 2050 by Akash Das. All rights reserved."
constructor() { }
ngOnInit(): void {
}
}main.component.html<main class="container">
<div class="row">
<app-article class="col-lg-9 box bg-light"></app-article>
<app-aside class="col-lg-3 box bg-info"></app-aside>
</div>
</main>article.component.html<h2 class="text-center">{{ article.heading }}</h2>
{{ article.introduction }}
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[0].body }}
</p>
</section>
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[1].body }}
</p>
</section>article.component.tsimport { Component, OnInit } from '@angular/core';
interface Section {
heading: string;
body: string;
}
interface Article {
heading: string;
introduction: string;
subsections: Section[];
}
@Component({
selector: 'app-article',
templateUrl: './article.component.html',
styleUrls: ['./article.component.css'],
})
export class ArticleComponent implements OnInit {
article: Article = {
heading: 'Article heading',
introduction:
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto officia illum molestiae dolore dolor quis enim distinctio velit nemo, error esse ad, unde, vitae possimus voluptatem sequi. Ex, earum quasi.',
subsections: [
{
heading: 'Subsection',
body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi eaque est quia adipisci? Fuga odit, magni eveniet impedit ad vel quidem under perspiciatis iste pariatur iure nobis incidunt! Odio, cumque?',
},
{
heading: 'Another subsection',
body: 'Asperiores saepe error odio delectus omnis sapiente voluptate facilis quos a dolore amet deserunt voluptates numquam vero quibusdam labore dolores quod laborum cum praesentium, expedita voluptatem sed molestiae? Ducimus, nisi!',
},
],
};
constructor() {}
ngOnInit(): void {}
}aside.component.html<div class="container">
<h2 class="text-center">Related</h2>
<div class="row">
<div class="offset-4 col-4 offset-lg-2 col-lg-8">
<ul>
<li>
<a href="">{{ asideList[0] }}</a>
</li>
<li>
<a href="">{{ asideList[1] }}</a>
</li>
<li>
<a href="">{{ asideList[2] }}</a>
</li>
<li>
<a href="">{{ asideList[3] }}</a>
</li>
</ul>
</div>
</div>
</div>aside.component.tsimport { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-aside',
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.css']
})
export class AsideComponent implements OnInit {
asideList: string[] =["Hello world","Learning bootstrap","Creating good looking pages","Responsive design"]
constructor() { }
ngOnInit(): void {
}
} |
Beta Was this translation helpful? Give feedback.
-
APP.COMPONENT.HTML<div class="bg-secondary">
<app-header></app-header>
<app-main></app-main>
<app-footer></app-footer>
</div>HEADER.COMPONENT.HTML<header class="container">
<h1 class="page-header text-center">{{ header.heading }}</h1>
<div class="row">
<nav
class="col-12 box navbar navbar-expand-lg navbar-fixed-top navbar-dark bg-info"
>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
>
<span class="navbar-toggler-icon"></span>
</button>
<form class="form-inline d-none d-sm-inline d-lg-none my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
<a class="navbar-brand" href="#0">
<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAABNVBMVEXdPTH///8gku3/wQcop0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5HnSLVgEsiIhBmdxoldHShAj481Asa6MWdky0XWSxWchEAIxG6k7e7jcbeOlxJnmVmEcjgODaOTnLHh4rTtXFEI+QFSGQDI414hBAxJmBcQuC7GBMwNiFJjCuDMQqJ81FjA8YoRInk2YazjBiF2bUXozP8b7xQWKQXjjiF2eyDhy/mXjx8EOvf/B+RePtEKX2jvgAAAABJRU5ErkJggg=="
alt="navbar-brand"
width="30"
height="30"
/>
Blog Nation
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active">{{ header.subsections[0].points }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ header.subsections[1].points }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ header.subsections[2].points }}</a>
</li>
</ul>
<form class="form-inline d-sm-none d-lg-inline my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
</div>
</nav>
</div>
</header>HEADER.COMPONENT.TSimport { Component, OnInit } from '@angular/core';
interface Section{
points : string
}
interface Header {
heading: string;
subsections: Section[];
}
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
header: Header = {
heading: 'Header',
subsections: [
{
points: 'Home',
},
{
points: 'Article',
},
{
points: 'Contact',
}
],
};
constructor() { }
ngOnInit(): void {
}
}MAIN.COMPONENT.HTML<main class="container">
<div class="row">
<app-article class="col-lg-9 box bg-light"></app-article>
<app-aside class="col-lg-3 box bg-info"></app-aside>
</div>
</main>ARTICLE.COMPONENT.HTML<h2 class="text-center">{{ article.heading }}</h2>
{{ article.introduction }}
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[0].body }}
</p>
</section>
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[1].body }}
</p>
</section>ARTICLE.COMPONENT.TSimport { Component, OnInit } from '@angular/core';
interface Section {
heading: string;
body: string;
}
interface Article {
heading: string;
introduction: string;
subsections: Section[];
}
@Component({
selector: 'app-article',
templateUrl: './article.component.html',
styleUrls: ['./article.component.css'],
})
export class ArticleComponent implements OnInit {
article: Article = {
heading: 'Article heading',
introduction:
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto officia illum molestiae dolore dolor quis enim distinctio velit nemo, error esse ad, unde, vitae possimus voluptatem sequi. Ex, earum quasi.',
subsections: [
{
heading: 'Subsection',
body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi eaque est quia adipisci? Fuga odit, magni eveniet impedit ad vel quidem under perspiciatis iste pariatur iure nobis incidunt! Odio, cumque?',
},
{
heading: 'Another subsection',
body: 'Asperiores saepe error odio delectus omnis sapiente voluptate facilis quos a dolore amet deserunt voluptates numquam vero quibusdam labore dolores quod laborum cum praesentium, expedita voluptatem sed molestiae? Ducimus, nisi!',
},
],
};
constructor() {}
ngOnInit(): void {}
}ASIDE.COMPONENT.HTML<div class="container">
<h2 class="text-center">{{ aside.heading }}</h2>
<div class="row">
<div class="offset-4 col-4 offset-lg-2 col-lg-8">
<ul>
<li>
<a href="">{{ aside.subsections[0].points }}</a>
</li>
<li>
<a href="">{{ aside.subsections[1].points }}</a>
</li>
<li>
<a href="">{{ aside.subsections[2].points }}</a>
</li>
<li>
<a href="">{{ aside.subsections[3].points }}</a>
</li>
</ul>
</div>
</div>
</div>ASIDE.COMPONENT.TSimport { Component, OnInit } from '@angular/core';
interface Section
{
points : string
}
interface Aside {
heading: string;
subsections: Section[];
}
@Component({
selector: 'app-aside',
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.css']
})
export class AsideComponent implements OnInit {
aside: Aside = {
heading: 'Related',
subsections: [
{
points: 'Hello world',
},
{
points: 'Learning bootstrap',
},
{
points: 'Creating good looking pages',
},
{
points: 'Responsive design',
},
],
};
constructor() { }
ngOnInit(): void {
}
}
|
Beta Was this translation helpful? Give feedback.
-
footer.components.tsimport { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
content: string = "Copyright 2050 by Akash Das. All rights reserved.";
constructor() { }
ngOnInit(): void {
}
}footer html<footer class="container box bg-light mb-2">
<div class="row p-3">
<div class="col-12">
© {{content}}
</div>
</div>
</footer>header.component.tsimport { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
brandname: string = "Blog Nation";
inputbox: string = "Search";
lists: string[] = ["HOME", "ARTICLES", "CONTACT"]
constructor() { }
ngOnInit(): void {
}
}header html<header class="container">
<h1 class="page-header text-center">Header</h1>
<div class="row">
<nav class="col-12 box navbar navbar-expand-lg navbar-fixed-top navbar-dark bg-info">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent">
<span class="navbar-toggler-icon"></span>
</button>
<form class="form-inline d-none d-sm-inline d-lg-none my-2 my-lg-0">
<input type="search" class="form-control mr-sm-2" name="searchBar" id="searchBar" />
<button class="btn btn-outline-light my-2 my-sm-0">{{inputbox}}</button>
</form>
<a class="navbar-brand" href="#0">
<img src="../../assets/img/logo.png" alt="navbar-brand" width="30" height="30" />
{{brandname}}
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active">{{lists[0]}}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{lists[1]}}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{lists[2]}}</a>
</li>
</ul>
<form class="form-inline d-sm-none d-lg-inline my-2 my-lg-0">
<input type="search" class="form-control mr-sm-2" name="searchBar" id="searchBar" />
<button class="btn btn-outline-light my-2 my-sm-0">{{inputbox}}</button>
</form>
</div>
</nav>
</div>
</header>main html<main class="container">
<div class="row">
<app-article class="col-lg-9 box bg-light"></app-article>
<app-aside class="col-lg-3 box bg-info"></app-aside>
</div>
</main>article.component.tsimport { Component, OnInit } from '@angular/core';
interface Section {
heading: string;
body: string;
}
interface Article {
heading: string;
introduction: string;
subsections: Section[];
}
@Component({
selector: 'app-article',
templateUrl: './article.component.html',
styleUrls: ['./article.component.css'],
})
export class ArticleComponent implements OnInit {
article: Article = {
heading: 'Article heading',
introduction:
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto officia illum molestiae dolore dolor quis enim distinctio velit nemo, error esse ad, unde, vitae possimus voluptatem sequi. Ex, earum quasi.',
subsections: [
{
heading: 'Subsection',
body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi eaque est quia adipisci? Fuga odit, magni eveniet impedit ad vel quidem under perspiciatis iste pariatur iure nobis incidunt! Odio, cumque?',
},
{
heading: 'Another subsection',
body: 'Asperiores saepe error odio delectus omnis sapiente voluptate facilis quos a dolore amet deserunt voluptates numquam vero quibusdam labore dolores quod laborum cum praesentium, expedita voluptatem sed molestiae? Ducimus, nisi!',
},
],
};
constructor() { }
ngOnInit(): void { }
}article html<h2 class="text-center">{{ article.heading }}</h2>
{{ article.introduction }}
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[0].body }}
</p>
</section>
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[1].body }}
</p>
</section>aside.component.tsimport { Component, OnInit } from '@angular/core';
interface lists {
item: string;
}
@Component({
selector: 'app-aside',
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.css']
})
export class AsideComponent implements OnInit {
heading: string = "Related";
list: string[] = ["Hello world", "Learning bootstrap", "Creating good looking pages", "Responsive designs"]
constructor() { }
ngOnInit(): void {
}
}aside html<div class="container">
<h2 class="text-center">{{heading}}</h2>
<div class="row">
<div class="offset-4 col-4 offset-lg-2 col-lg-8">
<ul>
<li><a href="">{{list[0]}}</a></li>
<li><a href="">{{list[1]}}</a></li>
<li><a href="">{{list[2]}}</a></li>
<li><a href="">{{list[3]}}</a></li>
</ul>
</div>
</div>
</div>app.html<div class="bg-secondary">
<app-header></app-header>
<app-main></app-main>
<app-footer></app-footer>
</div>
|
Beta Was this translation helpful? Give feedback.
-
|
header.component.html <header class="container">
<h1 class="page-header text-center">Header</h1>
<div class="row">
<nav
class="col-12 box navbar navbar-expand-lg navbar-fixed-top navbar-dark bg-info"
>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
>
<span class="navbar-toggler-icon"></span>
</button>
<form class="form-inline d-none d-sm-inline d-lg-none my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">
{{ menuOptions[0] }}
</button>
</form>
<a class="navbar-brand" href="#0">
<img
src="../../assets/img/logo.png"
alt="navbar-brand"
width="30"
height="30"
/>
Blog Nation
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active">{{ menuOptions[1] }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ menuOptions[2] }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ menuOptions[3] }}</a>
</li>
</ul>
<form class="form-inline d-sm-none d-lg-inline my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
</div>
</nav>
</div>
</header>header.component.ts import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
menuOptions: string[]=["Search","HOME","ARTICLES","CONTACT"]
constructor() { }
ngOnInit(): void {
}
}main.component.html <main class="container">
<div class="row">
<app-article class="col-lg-9 box bg-light"></app-article>
<app-aside class="col-lg-3 box bg-info"></app-aside>
</div>
</main>article.component.html <h2 class="text-center">{{ article.heading }}</h2>
{{ article.introduction }}
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[0].body }}
</p>
</section>
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[1].body }}
</p>
</section>article.component.ts import { Component, OnInit } from '@angular/core';
interface Section {
heading: string;
body: string;
}
interface Article {
heading: string;
introduction: string;
subsections: Section[];
}
@Component({
selector: 'app-article',
templateUrl: './article.component.html',
styleUrls: ['./article.component.css'],
})
export class ArticleComponent implements OnInit {
article: Article = {
heading: 'Article heading',
introduction:
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto officia illum molestiae dolore dolor quis enim distinctio velit nemo, error esse ad, unde, vitae possimus voluptatem sequi. Ex, earum quasi.',
subsections: [
{
heading: 'Subsection',
body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi eaque est quia adipisci? Fuga odit, magni eveniet impedit ad vel quidem under perspiciatis iste pariatur iure nobis incidunt! Odio, cumque?',
},
{
heading: 'Another subsection',
body: 'Asperiores saepe error odio delectus omnis sapiente voluptate facilis quos a dolore amet deserunt voluptates numquam vero quibusdam labore dolores quod laborum cum praesentium, expedita voluptatem sed molestiae? Ducimus, nisi!',
},
],
};
constructor() {}
ngOnInit(): void {}
}aside.component.html <div class="container">
<h2 class="text-center">Related</h2>
<div class="row">
<div class="offset-4 col-4 offset-lg-2 col-lg-8">
<ul>
<li>
<a href="">{{ asideList[0] }}</a>
</li>
<li>
<a href="">{{ asideList[1] }}</a>
</li>
<li>
<a href="">{{ asideList[2] }}</a>
</li>
<li>
<a href="">{{ asideList[3] }}</a>
</li>
</ul>
</div>
</div>
</div>aside.component.ts import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-aside',
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.css']
})
export class AsideComponent implements OnInit {
asideList: string[] =["Hello world","Learning bootstrap","Creating good looking pages","Responsive design"]
constructor() { }
ngOnInit(): void {
}
}footer.component.html <footer class="container box bg-light mb-2">
<div class="row p-3">
<div class="col-12">© {{ footerClause }}</div>
</div>
</footer>footer.component.ts import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
footerClause: string = " Copyright 2050 by Akash Das. All rights reserved."
constructor() { }
ngOnInit(): void {
}
}app.component.html <div class="bg-secondary">
<app-header></app-header>
<app-main></app-main>
<app-footer></app-footer>
</div> |
Beta Was this translation helpful? Give feedback.
-
|
header.component.html header.component.ts main.component.html main.component.ts article.component.html article.component.ts aside.component.html aside.component.ts app.component.html |
Beta Was this translation helpful? Give feedback.
-
|
header.component.html <header class="container">
<h1 class="page-header text-center">{{ header.heading }}</h1>
<div class="row">
<nav
class="col-12 box navbar navbar-expand-lg navbar-fixed-top navbar-dark bg-info"
>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
>
<span class="navbar-toggler-icon"></span>
</button>
<form class="form-inline d-none d-sm-inline d-lg-none my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
<a class="navbar-brand" href="#0">
<img
src="https://tse2.mm.bing.net/th/id/OIP.HIlPRjLZcRF4Sdi70t3K6gHaHa?pid=ImgDet&rs=1"
alt="navbar-brand"
width="30"
height="30"
/>
Publications
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active">{{ header.subsections[0].points }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ header.subsections[1].points }}</a>
</li>
<li class="nav-item">
<a class="nav-link">{{ header.subsections[2].points }}</a>
</li>
</ul>
<form class="form-inline d-sm-none d-lg-inline my-2 my-lg-0">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
</div>
</nav>
</div>
</header>header.component.ts import { Component, OnInit } from '@angular/core';
interface Section{
points : string
}
interface Header {
heading: string;
subsections: Section[];
}
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
header: Header = {
heading: 'Header',
subsections: [
{
points: 'Home',
},
{
points: 'Article',
},
{
points: 'Contact',
}
],
};
constructor() { }
ngOnInit(): void {
}
}footer.component.ts import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
footText: string = 'Copyright 2050 by Akash Das. All rights reserved.';
constructor() { }
ngOnInit(): void {
}
}footer.component.html <footer class="container box bg-light mb-2">
<div class="row p-3">
<div class="col-12">© {{ footText }}</div>
</div>
</footer>main.component.ts import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.css']
})
export class MainComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}aside.component.html <div class="container">
<h2 class="text-center">{{ aside.heading }}</h2>
<div class="row">
<div class="offset-4 col-4 offset-lg-2 col-lg-8">
<ul>
<li>
<a href="">{{ aside.subsections[0].points }}</a>
</li>
<li>
<a href="">{{ aside.subsections[1].points }}</a>
</li>
<li>
<a href="">{{ aside.subsections[2].points }}</a>
</li>
<li>
<a href="">{{ aside.subsections[3].points }}</a>
</li>
</ul>
</div>
</div>
</div>aside.component.ts import { Component, OnInit } from '@angular/core';
interface Section
{
points : string
}
interface Aside {
heading: string;
subsections: Section[];
}
@Component({
selector: 'app-aside',
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.css']
})
export class AsideComponent implements OnInit {
aside: Aside = {
heading: 'Related',
subsections: [
{
points: 'Hello world',
},
{
points: 'Learning bootstrap',
},
{
points: 'Creating good looking pages',
},
{
points: 'Responsive design',
},
],
};
constructor() { }
ngOnInit(): void {
}
}article.component.html <h2 class="text-center">{{ article.heading }}</h2>
{{ article.introduction }}
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[0].body }}
</p>
</section>
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[1].body }}
</p>
</section>article.component.ts import { Component, OnInit } from '@angular/core';
interface Section {
heading: string;
body: string;
}
interface Article {
heading: string;
introduction: string;
subsections: Section[];
}
@Component({
selector: 'app-article',
templateUrl: './article.component.html',
styleUrls: ['./article.component.css'],
})
export class ArticleComponent implements OnInit {
article: Article = {
heading: 'Article heading',
introduction:
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto officia illum molestiae dolore dolor quis enim distinctio velit nemo, error esse ad, unde, vitae possimus voluptatem sequi. Ex, earum quasi.',
subsections: [
{
heading: 'Subsection',
body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi eaque est quia adipisci? Fuga odit, magni eveniet impedit ad vel quidem under perspiciatis iste pariatur iure nobis incidunt! Odio, cumque?',
},
{
heading: 'Another subsection',
body: 'Asperiores saepe error odio delectus omnis sapiente voluptate facilis quos a dolore amet deserunt voluptates numquam vero quibusdam labore dolores quod laborum cum praesentium, expedita voluptatem sed molestiae? Ducimus, nisi!',
},
],
};
constructor() {}
ngOnInit(): void {}
}app.component.html <div class="bg-secondary">
<app-header></app-header>
<app-main></app-main>
<app-footer></app-footer>
</div> |
Beta Was this translation helpful? Give feedback.
-
header.component.html<header>
<h1>Header</h1>
</header>
<main>
<nav
class="navbar navbar-expand-lg navbar-fixed-top navbar-dark mt-5"
style="background-color: green"
>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
>
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#0">
<img
src="../../assets/img/autodesk-autocad.png"
alt="navbar-brand"
width="30"
height="30"
/>
Article Blog
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<form class="form-inline mr-auto my-2 my-lg-0 mr-2">
<input
type="search"
class="form-control mr-sm-2"
name="searchBar"
id="searchBar"
/>
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
<ul class="navbar-nav">
<li class="nav-item">
<a href="#" class="nav-link active">
<strong>Home</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Project</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Our Team</strong>
</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a
href="#"
class="nav-link dropdown-toggle"
role="button"
data-toggle="dropdown"
>
<strong>Account</strong>
<!-- person icon SVG image -->
<img
src="../../assets/img/png-transparent-user-profile-computer-icons-login-user-avatars.png"
alt="navbar-brand"
width="30"
height="30"
/></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="#" class="dropdown-item"> <strong>Profile</strong> </a
><a href="#" class="dropdown-item"><strong>Support</strong></a>
<a href="#" class="dropdown-item">
<div class="dropdown-divider"></div>
<strong>Logout</strong>
</a>
</div>
</li>
</ul>
</div>
</nav>
</main>main.component.html<main>
<div class="row my-2">
<app-article class="col-md-8" style="background-color: white"></app-article>
<app-aside
class="col-md-4 border border-dark"
style="background-color: green"
></app-aside>
</div>
</main>article.component.html<h2 class="text-center">{{ article.heading }}</h2>
{{ article.introduction }}
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[0].body }}
</p>
</section>
<section>
<h3>{{ article.subsections[0].heading }}</h3>
<p>
{{ article.subsections[1].body }}
</p>
</section>article.component.tsimport { Component, OnInit } from '@angular/core';
interface Section {
heading: string;
body: string;
}
interface Article {
heading: string;
introduction: string;
subsections: Section[];
}
@Component({
selector: 'app-article',
templateUrl: './article.component.html',
styleUrls: ['./article.component.css']
})
export class ArticleComponent implements OnInit {
article: Article = {
heading: 'Article heading',
introduction:
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto officia illum molestiae dolore dolor quis enim distinctio velit nemo, error esse ad, unde, vitae possimus voluptatem sequi. Ex, earum quasi.',
subsections: [
{
heading: 'Subsection',
body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi eaque est quia adipisci? Fuga odit, magni eveniet impedit ad vel quidem under perspiciatis iste pariatur iure nobis incidunt! Odio, cumque?',
},
{
heading: 'Another subsection',
body: 'Asperiores saepe error odio delectus omnis sapiente voluptate facilis quos a dolore amet deserunt voluptates numquam vero quibusdam labore dolores quod laborum cum praesentium, expedita voluptatem sed molestiae? Ducimus, nisi!',
},
],
};
constructor() { }
ngOnInit(): void {
}
}aside.component.html<div>
<h1>Related</h1>
<ul class="list-unstyled text">
<li>
<a href="https://www.google.com">Oh I do like to be beside the seaside</a>
</li>
<li>
<a href="https://www.google.com">Oh I do like to be beside the sea</a>
</li>
<li>
<a href="https://www.google.com">Although in the North of England</a>
</li>
<li>
<a href="https://www.google.com">It never stops raining</a>
</li>
<li><a href="https://www.google.com">Oh wel...</a></li>
</ul>
</div>footer.component.html<main>
<div class="row my-2">
<footer class="col-md-12">
<i> © Copyright 2022 All rights concerned</i>
</footer>
</div>
</main>screentshot |
Beta Was this translation helpful? Give feedback.
-
footer.component.html<div class="col-12 border border-dark border-10 bg-primary mx-2">
<footer>
@Copyright 2050 by nobody. All rights reserved.
</footer>
</div>header.componnent.html<nav class="navbar navbar-expand-lg navbar-fixed-top navbar-dark bg-primary">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent">
<span class="navbar-toggler-icon"></span>
</button>
<form class="form-inline mr-auto my-2 my-lg-0 mr-2">
<input type="search" class="form-control mr-sm-2" name="searchBar" id="searchBar" />
<button class="btn btn-outline-light my-2 my-sm-0">Search</button>
</form>
<a class="navbar-brand" href="#0">
Kitchen Story
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a href="#" class="nav-link active">
<strong>Home</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>Products</strong>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<strong>About</strong>
</a>
</li>
</ul>
</div>
<button class="navbar-toggler dropdown-toggle" type="button" data-toggle="collapse" data-target="#accountDropdown">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person"
viewBox="0 0 16 16">
<path
d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z" />
</svg>
</button>
<div class="collapse navbar-collapse" id="accountDropdown">
<ul class="navbar-nav">
<li class="nav-item"><a href="" class="nav-link"><strong>Profile</strong></a></li>
<li class="nav-item"><a href="" class="nav-link"><strong>Support</strong></a></li>
<li class="nav-item"><a href="" class="nav-link"><strong>Logout</strong></a></li>
</ul>
</div>
</nav>main.component.html<app-left-side-bar></app-left-side-bar>
<div class="row mb-2 mt-2 mx-2">
<div class="container col-12 col-md-2 col-lg-1 border border-dark" style="background-color: rgb(210, 51, 146) ">
<aside>
<ul class="list-unstyled">
<li class="list-item">Sports</li>
<li class="list-item">Football</li>
<li class="list-item">Hockey</li>
<li class="list-item">Badmaniton</li>
<li class="list-item">Tennis</li>
</ul>
</aside>
</div>
<!-- main content -->
<div class=" container col-12 col-md-10 col-lg-9 border border-dark border-10"
style="background-color: rgb(246, 236, 242) ">
<main>
<article>
<section>
<h2>
Article Heading
</h2>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur, pariatur!
Praesentium
voluptatem rerum cumque optio eligendi debitis, iure nam nihil dignissimos, quibusdam
est
aliquam
assumenda odio officia natus architecto molestiae!
</p>
</section>
<section>
<h3>Subsection</h3>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos minus itaque quasi,
nesciunt
sapiente
magnam aliquid amet, consequatur obcaecati quo ipsum? Provident quisquam voluptates
debitis
nobis
repudiandae voluptatum sint assumenda!
</p>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos minus itaque quasi,
nesciunt
sapiente
magnam aliquid
amet, consequatur obcaecati quo ipsum? Provident quisquam voluptates debitis nobis
repudiandae
voluptatum sint
assumenda!
</p>
</section>
<section>
<h3>Another Subsection</h3>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos minus itaque quasi,
nesciunt
sapiente
magnam aliquid
amet, consequatur obcaecati quo ipsum? Provident quisquam voluptates debitis nobis
repudiandae
voluptatum sint
assumenda!
</p>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos minus itaque quasi,
nesciunt
sapiente
magnam aliquid
amet, consequatur obcaecati quo ipsum? Provident quisquam voluptates debitis nobis
repudiandae
voluptatum sint
assumenda!
</p>
</section>
</article>
</main>
</div>
</div>
<app-right-side-bar></app-right-side-bar>leftSide.component.html<div class="container col-12 col-md-2 col-lg-1 border border-dark" style="background-color: rgb(210, 51, 146) ">
<aside>
<ul class="list-unstyled">
<li class="list-item">Sports</li>
<li class="list-item">Football</li>
<li class="list-item">Hockey</li>
<li class="list-item">Badmaniton</li>
<li class="list-item">Tennis</li>
</ul>
</aside>
</div>rightSide.component.html<!-- right sidebar -->
<aside name="rightsidebar" class=" container col-12 col-md-12 col-lg-2 border border-dark border-10"
style="background-color: rgb(199, 60, 138)">
<ul>
<li class=" sidebar-heading">Related</li>
<li><a href="www.india.com">India</a></li>
<li><a href="www.France.com">France</a></li>
<li><a href="www.Germany.com">Germany</a></li>
<li><a href="www.Finland.com">Finland</a></li>
</ul>
</aside> |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Clone the Angular repository. In the repo, a demo project named
[bootstrap-manual-app](https://github.com/akash-coded/angular/tree/main/angular-apps/bootstrap-manual-app)is present.Currently, in all the components apart from the
articlecomponent, the design and the data are present in the component template (HTML) files.You need to follow the separation of design and data in the
[article](https://github.com/akash-coded/angular/tree/main/angular-apps/bootstrap-manual-app/src/app/main/article)component and similarly modify the remaining components with appropriate logic in the component classes, and by using one-way data binding (interpolation) in the component templates.Beta Was this translation helpful? Give feedback.
All reactions