1
0
Fork 0
freesewing/markdown/dev/reference/api/config/inject/en.md

31 lines
704 B
Markdown
Raw Normal View History

---
title: inject
---
2022-02-05 17:44:23 +01:00
The `inject` key in the pattern configuration file allow you to configure
the rules for injecting one part into another.
2022-02-20 14:35:50 +01:00
By _injecting_ we mean that rather than starting out with a fresh part,
2022-02-05 17:44:23 +01:00
you'll get a part that has the points, paths, and snippets of the injected part.
## Structure
2022-02-19 08:04:25 +01:00
A plain object of key/value pairs of parts.
2022-02-05 17:44:23 +01:00
The `value` part will be injected in the `key` part.
## Example
```js
inject: {
front: "back"
}
```
2022-02-05 17:44:23 +01:00
In this example, the `back` part will be injected in the `front` part.
In doing so, the `front` part will start out as a copy of the `back` part.
<Tip>
2022-02-05 17:44:23 +01:00
See [the Howto on Part inheritance](/howtos/code/inject) for a hands-on example.
</Tip>