mohnish/money

View on GitHub
app/assets/javascripts/money/views/alerts_view.js

Summary

Maintainability
A
0 mins
Test Coverage

M.AlertsView = M.AbstractView.extend({
  templatePath: 'alerts/index',

  initialize: function(options) {
    this.options = this.setupOptions(options);
    this.render();
  },

  render: function() {
    this.$el.html(this.template(this.options));
    return this;
  },

  setupOptions: function(options) {
    var defaults = { type: 'danger', message: 'oops... an error occurred' };
    return _.defaults(options, defaults);
  }
});