angular-if-state
================

> Directives to show or hide an element depending on the current UI Router state

[![npm version](https://badge.fury.io/js/angular-if-state.svg)](http://badge.fury.io/js/angular-if-state)
[![dependencies](https://david-dm.org/jviotti/angular-if-state.svg)](https://david-dm.org/jviotti/angular-if-state.svg)
[![Build Status](https://travis-ci.org/jviotti/angular-if-state.svg?branch=master)](https://travis-ci.org/jviotti/angular-if-state)

Installation
------------

Install `angular-if-state` by running:

```sh
$ npm install --save angular-if-state
```

Documentation
-------------

Add `angular-if-state` to your Angular module dependency list:

```js
var MyApp = angular.module('MyApp', [
  require('angular-if-state')
]);
```

### `show-if-state`

This directive provides an attribute to show an element when the current UI Router state matches the specified one.

```html
<button show-if-state="main" ui-sref="settings">Settings</button>
```

### `hide-if-state`

This directive provides an attribute to hide an element when the current UI Router state matches the specified one.

```html
<button hide-if-state="settings" ui-sref="main">Go Back</button>
```

Support
-------

If you're having any problem, please [raise an issue](https://github.com/jviotti/angular-if-state/issues/new) on GitHub and I'll be happy to help.

Tests
-----

Run the test suite by doing:

```sh
$ npm test
```

Contribute
----------

- Issue Tracker: [github.com/jviotti/angular-if-state/issues](https://github.com/jviotti/angular-if-state/issues)
- Source Code: [github.com/jviotti/angular-if-state](https://github.com/jviotti/angular-if-state)

Before submitting a PR, please make sure that you include tests, and that [jshint](http://jshint.com) runs without any warning:

```sh
$ npm run lint
```

License
-------

The project is licensed under the MIT license.
