Skip to content

Instantly share code, notes, and snippets.

@stewones
Created February 25, 2015 19:39
Show Gist options
  • Save stewones/1eea87f46e9d641eeb48 to your computer and use it in GitHub Desktop.
Save stewones/1eea87f46e9d641eeb48 to your computer and use it in GitHub Desktop.
angular.js service to work with seo in ES6 format
'use strict';
class PageFactory {
/*@ngInject*/
constructor() {
this.title = '';
this.description = '';
this.banner = true;
return {
load: load(),
progress: progress(),
setTitle: setTitle,
setDescription: setDescription,
getDescription: getDescription,
banner: this.banner
}
//
// SEO
//
function setTitle(str) {
this.title = str;
}
function setDescription(str) {
this.description = str;
}
function getDescription() {
return this.description;
}
//
// PAGE LOADER
//
function load() {
return {
init: function() {
this.status = true;
//console.log('loader iniciado...' + this.status);
},
done: function() {
this.status = false;
//console.log('loader finalizado...' + this.status);
}
}
}
//
// PROGRESS (SPIN)
//
function progress() {
return {
init: function() {
this.status = true;
//console.log('progress iniciado...' + this.status);
},
done: function() {
this.status = false;
//console.log('progress finalizado...' + this.status);
}
}
}
}
}
export
default PageFactory;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment