salix/client/core/src/lib/app.js

24 lines
536 B
JavaScript
Raw Normal View History

import {module} from '../module';
/**
* The main application class.
*
* @property {String} name The application name.
* @property {Snackbar} snackbar The main object to show messages.
*/
export default class App {
show(message) {
if (this.snackbar)
this.snackbar.show({message: message});
else
console.log(message);
}
showMessage(message) {
this.show(message);
}
showError(message) {
this.show(`Error: ${message}`);
}
}
module.service('vnApp', App);