Skip to content

murwa/ui-router-errors

Repository files navigation

Build Status

UI-Router Errors

An angularjs module to easily handle errors between and on states

Installation

Bower:

bower install ui-router-errors

In your page, add:

<script src="bower_components/ui-router-errors/dist/ui-router-errors.min.js"></script>

Usage

Load module

Add the module as a dependency to your app:

var app = angular.module('app', ['ui-router-errors']

State Definition

Easiest

Simply add your error state like so:

    var state = {
        name: 'errors',
        template: 'Error occured',
        controller: ['$errors', function($errors){
            var self = this;
            angular.extend(self, $errors);

            // Access get methods in your template
        }]
    }

About

An angularjs module to easily handle errors between and on states

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published