Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

UIApplication

Adarsh Pastakia edited this page Mar 27, 2017 · 3 revisions
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, ...)

Getting Started

Core Elements
Input Elements
  • UIButton
  • UIFieldset
  • UIForm
  • UIInputGroup
  • UIInput
  • UITextarea
  • UIDate
  • UIPhone
  • UICheckbox
  • UIRadio
  • UISwitch
  • UICombo
  • UITag
  • UIList
  • UIReorder
  • UILanguage
  • UIMarkdown
Components
API Classes
Clone this wiki locally