In this step by step Angular 8/9/10 SEO tutorial, we are going to learn how to make Angular app SEO friendly by adding the page titles, meta descriptions, keywords, and other SEO attributes in an Angular Universal Server-side rendering app.
Angular offers the Title and Meta services, and these tags are similar HTML meta tags that help in achieving the purpose of making the Angular app SEO friendly.
Meta is a service in Angular, and it belongs to a class family. Angular offers various Meta services to add, read, update, and remove HTML meta elements.
Let us check out the various Meta service methods:
addTag(): Includes one meta tag.
updateTag(): Updates meta tag in angular component.
removeTag(): Removes meta tag for the specified selector.
getTag(): Gets HTMLMetaElement for the specified meta selector.
addTags(): Includes more than one meta tag in angular component.
getTags(): Returns array of HTMLMetaElement for the specified meta selector.
removeTagElement(): Removes meta tag for the specified HTMLMetaElement
In this Angular 8|9 SEO tutorial, we will learn to add, update, HTML meta tag examples for keywords, description, robots, date, author, viewport, charset using Angular Meta service.
Configure Angular Universal Project
We are going to make Angular app SEO compatible, to enable the SEO in Angular, we are going to use Angular universal app. It’s a music app built with MongoDB server-side rendering. Let us take the Git clone from the following Github repo:
Run following command to install the required packages:
npm install
Set up Angular Meta Service
Go to app/app.component.ts file and import Angular Meta service. The Meta service allow us to add keywords, robots, author, viewport, date and charset in Angular
import { Meta } from '@angular/platform-browser';
Now, also add the following code in the same file. Here, we inject the private metaTagService: Meta in the constructor and then used the Meta’s addTags() method to configure the following HTML meta attributes.
Adding SEO Title and Meta Description in Angular Component
Now, we will set Title and Meta Description in Angular Universal app. First import Title, Meta from @angular/platform-browser. Go to app/components/add-song/add-song.component.ts file and add the following code in it.
import { Title, Meta } from '@angular/platform-browser';
@Component({
selector: 'app-add-song',
templateUrl: './add-song.component.html',
styleUrls: ['./add-song.component.css']
})
export class AddSongComponent implements OnInit {
title = 'Add Song - Angular Universal CRUD App';
constructor(
private titleService: Title,
private metaTagService: Meta
) { }
ngOnInit() {
this.titleService.setTitle(this.title);
this.metaTagService.updateTag(
{ name: 'description', content: 'Add song template' }
);
}
}
Here we defined the SEO title with the appropriate value. Then we declared the SEO title with the help of the setTitle() method inside the ngOnInit lifecycle hook.
We also declared the Meta description in Angular with the help of Meta’s updateTag() method.
Adding Canonical URL in Angular 8|9
SEO is the essential element of any site, and Canonical URLs allow search engines about duplicate content. When the site gets bigger, it becomes tedious to prevent web pages from generating duplicate URLs. This problem might lead to a duplicate content issue. A canonical URL provides a professional solution to get rid from duplicate content issues.
Pay your credit card bills & loan EMIs before due date
Consistency of timely payment of credit card bills and EMIs is the most important factor to impact your Credit Score. Please make sure you do not miss bill or EMI due dates as your credit score reduces if there is delay in repayments.
Reduce utilization of Credit Card limits
While you may be paying back your credit card bills on time, high usage of credit cards still indicates too much dependence on available credit line and possible lack of inflow of your own funds. As a result, your Credit Score can get negatively impacted. So, either you should reduce your dependence on credit cards or get credit limits of credit cards increased.
Don’t apply for loans and credit cards with multiple banks
When you apply for any credit card or loan with a financial institution (bank or NBFC). that financial institution fetches your credit card history and score from one or more Credit Bureaus. Basis your credit history and score, financial institution evaluates your ability to repay on time. Now each credit history enquiry by a financial institution is also recorded by same Credit Bureau where enquiry was made. So, if a financial institution sees multiple enquiries on your credit history by other institutions, it considers you to be credit hungry and to be less reliable in repaying on time.
Obtain your Credit Report regularly and check for errors
While you think you have a good credit history, in rare cases there may be certain errors in your credit history reported by your lenders to Credit Bureaus. As a result of those errors, your Credit Score could have reduces considerably. For example, you have completely paid off your personal loan and closed the loan account, but your credit report from Credit Bureau may still be showing up unpaid amount under same personal loan account. In such errors you can either approach any Credit Bureau or your lender to get the correction done.
To install the microsoft loopback adapter on win 10 you must:
right click on window start menu icon and select Device manager. Device manager window will immediately open (or you may use any other way how to open device manager window)
click on Action, and select Add legacy hardware
click Next on welcome screen
choose “Install the hardware that i manually select from a list” and click on Next
scroll down and select Network adapters from offered common hardware types and click on Next
select Microsoft as the manufacturer, and then select Microsoft KM-TEST Loopback adapter card model, click on Next
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Aditya Kumar Singh</title>
<style>
@media (max-width:1900px)
{
div{
background-color:#09AD40;
}
}
@media (max-width:1300px)
{
div{
background-color:#787171;
}
}
@media (max-width:1280px)
{
div{
background-color:#D81114;
}
}
@media (max-width:1024px)
{
div{
background-color:#171515;
}
}
@media (max-width:800px)
{
div{
background-color:#18B02E;
}
}
@media (max-width:768px)
{
div{
background-color:#1922C4;
}
}
@media (max-width:500px)
{
div{
background-color:#7A21C5;
}
}
@media (max-width:300px)
{
div{
background-color:#A46804;
}
}
</style>
</head>
<body>
<div>
<p>
On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look.
You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also format text directly by using the other controls on the Home tab. Most controls offer a choice of using the look from the current theme or using a format that you specify directly.
To change the overall look of your document, choose new Theme elements on the Page Layout tab. To change the looks available in the Quick Style gallery, use the Change Current Quick Style Set command. Both the Themes gallery and the Quick Styles gallery provide reset commands so that you can always restore the look of your document to the original contained in your current template.
</p>
</div>
</body>
</html>