* chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
28 lines
639 B
JavaScript
28 lines
639 B
JavaScript
import { MotdViewModel } from '../../models/motd';
|
|
|
|
angular.module('portainer.app').factory('MotdService', [
|
|
'$q',
|
|
'Motd',
|
|
function MotdServiceFactory($q, Motd) {
|
|
'use strict';
|
|
var service = {};
|
|
|
|
service.motd = function () {
|
|
var deferred = $q.defer();
|
|
|
|
Motd.get()
|
|
.$promise.then(function success(data) {
|
|
var motd = new MotdViewModel(data);
|
|
deferred.resolve(motd);
|
|
})
|
|
.catch(function error(err) {
|
|
deferred.reject({ msg: 'Unable to retrieve information message', err: err });
|
|
});
|
|
|
|
return deferred.promise;
|
|
};
|
|
|
|
return service;
|
|
},
|
|
]);
|