Skip to content

Add support for storing templates #43

@themeteorchef

Description

@themeteorchef

There should be a simple API for storing alert templates. E.g., we may always want to use the same alert over and over with a different (optional) title/type/message. It should be possible to do something like:

Bert.templates = {
  error(message, type, title) {
    return { message, type: 'growl-top-right', title, style: 'danger', icon: 'fa-remove' };
  },
};

// In the app

Bert.error('Something went wrong'); // No need to do Bert.alert('Something went wrong', 'danger');

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions