Skip to content

Commit

Permalink
docs(API): add example about how to use one way binding on Component
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Apr 2, 2016
1 parent 843a5a4 commit 9b43a34
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,8 @@ Note:
An alternative and more declarative way to using the `inputs` property on `@Component`/`@Directive`.
Binds to controller via `=` binding or gets expression on directive via `$scope.$watch`
Binds to Component via two way binding `=` by default or via one way binding on Directive by default.
If you wanna use one way binding on Component use `@Input('<') yourProperty`
*Example:*
Expand All @@ -709,18 +710,19 @@ import { Component, Input } from 'ng-metadata/core';
@Component({ ... })
class MenuDropdown {
@Input() options;
@Input('<') oneWay;
@Input('aliasMe') value;
}
```
```html
<menu-dropdown options="ctrl.options" alias-me="ctrl.foo"></menu-dropdown>
<menu-dropdown one-way="ctrl.someValue" options="ctrl.options" alias-me="ctrl.foo"></menu-dropdown>
```
###### Parameters
| Parameter | Type | Description |
| ------------- | ---------|------------------------------------------ |
| **exposedName** | `string` | If provided, then it will be the name of the input when setting on the html element. |
| Parameter | Type | Description |
| ---------------- | ---------|------------------------------------------ |
| **exposedName** | `string` | If provided, then it will be the name of the input when setting on the html element. It supports oneWay binding via `<' sign + followed by optional alias |


## @Output
Expand Down

0 comments on commit 9b43a34

Please sign in to comment.