First of all, you should form title meta tags and description.
const metaTags = {
get(metaTagName) {
switch (metaTagName) {
case `titleMeta`:
return angular.element(`meta[property="og:title"]`);
case `descriptionMeta`:
return angular.element(`meta[property="og:description"], meta[name="description"]`);
}
}
}
Now, you have to create the function which will receive our title in a form of string through the parameters.
const metaTags = {
get(metaTagName) {
switch (metaTagName) {
case `titleMeta`:
return angular.element(`meta[property="og:title"]`);
case `descriptionMeta`:
return angular.element(`meta[property="og:description"], meta[name="description"]`);
}
},
set({ title, description }) {
if (!angular.isUndefined(title)) {
this.get(`titleMeta`).prop(`content`, title);
}
if (!angular.isUndefined(description)) {
this.get(`descriptionMeta`).prop(`content`, description);
}
}
}
The first steps are passed. This article will help you to complete SEO optimization process very quikly and easily. http://computoolsglobal.com/blog/angular-seo-optimization/
solved SEO optimization of Angular.JS project [closed]