UIApplication - adarshpastakia/aurelia-ui-framework GitHub Wiki

Usage
import {UIApplication} from 'aurelia-ui-framework';

@autoinject()
export class Example {
  constructor(public app:UIApplication) { ... }
}
Properties
  • constants:UIConstants

    <!-- my-view.html -->
    <h1>${app.constants.Title}</h1>
  • Authenticated

  • AuthUser: Used for sending authorization header on fetch calls

  • AuthToken: Used for sending authorization header on fetch calls

Methods
  • login({ username, token }, initialRoute?)

  • logout()

  • navigateTo(routeName, params = {}, options?)

  • routeActive(route)

  • toast(message | toastConfig, container?)

  • toastError(message, container?)

  • toastSuccess(message, container?)

ToastConfig {
  title,
  message,
  glyph,
  timeout,
  theme: Dark | Primary | Secondary | Info | Danger | Success | Warning
}
  • alert(message | AlertConfig):Promise<Boolean>
  • confirm(message | AlertConfig):Promise<Boolean>
  • prompt(message | AlertConfig):Promise<String>
AlertConfig {
  title,
  message,
  glyph,
  okLabel,
  // Confirm and Prompt only
  cancelLabel,
  // Prompt Only
  type: 'single' | 'multiline'
}
  • Sharing data across routes

    • shared(key, value?)
    • session(key, value?)
    • persist(key, value?)

    Passing no value will delete the key item, shared(this application instance only), session(sessionStorage), persist(localStorage)

  • Logging

    • info(tag, message, ...)
    • warn(tag, message, ...)
    • debug(tag, message, ...)
    • error(tag, message, ...)
⚠️ **GitHub.com Fallback** ⚠️