Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Update Extending Models
authored
Jun 12, 2018
by
Steven Collins
Show whitespace changes
Inline
Side-by-side
Extending-Models.md
View page @
ea52f7a1
...
@@ -3,7 +3,16 @@
...
@@ -3,7 +3,16 @@
## Getting the class mixin function
## Getting the class mixin function
The class mixers can be accessed in two ways, the first being:
The class mixers can be accessed in two ways, the first being:
```
javascript
```
javascript
import
{
associationMixer
,
Association
}
from
'
@openrailuk/common
'
;
associationMixer
(
yourMixin
);
```
or you can use
```
javascript
import
*
as
common
from
'
@openrailuk/common
'
;
import
*
as
common
from
'
@openrailuk/common
'
;
common
.
associationMixer
common
.
associationMixer
(
yourMixin
);
```
```
An example usage of the mixins can be found at this snippet:
<script
src=
"https://gitlab.com/openrail/uk/common-nodejs/snippets/1723609.js"
></script>
\ No newline at end of file