Skip to content

Commit

Permalink
Merge pull request #436 from strongloop/enum
Browse files Browse the repository at this point in the history
fix(docs): update enum type
  • Loading branch information
dhmlau authored Sep 17, 2020
2 parents 68e671a + 236b4b7 commit c681b2d
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,23 +434,7 @@ startTime: Date;
### Enum
Enums are special. Create an Enum using Enum factory:
```ts
const MOOD = dataSource.EnumFactory('glad', 'sad', 'mad');
MOOD.SAD; // 'sad'
MOOD(2); // 'sad'
MOOD('SAD'); // 'sad'
MOOD('sad'); // 'sad'

export class User extends Entity {
//..
@property({
type: MOOD,
})
mood: MOOD;
}
```
See the [Model ENUM property](https://loopback.io/doc/en/lb4/Model.html#enum-property) for details.
### Default Clause/Constant
Expand Down

0 comments on commit c681b2d

Please sign in to comment.