Created
February 25, 2015 19:39
-
-
Save stewones/1eea87f46e9d641eeb48 to your computer and use it in GitHub Desktop.
angular.js service to work with seo in ES6 format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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