- Make your content editable
- Create a custom component
- General usage
- AngularJS 1
- Angular 2
- Data only
- Global methods
- Component HTML
- Component CSS
- Kitchen Sink
- Content Block
- Team Page
- Contact Form
- Carousel (Slideshow)
To use components with AngularJS v1, add the component tag in an Angular template and call
Component.render() to render the components.
One way to do this is in your HTML template and your controller:
Another way is to use a directive:
Either way works equally well, so you can use whichever method you prefer.
You can use
Component.render() by itself or with a callback or promise. See the section on Component.render for more.
The following example shows 2 components being rendered: 1 with the controller approach (aldlk: the card) and 1 with the directive approach (mladl: the side menu).
You can render multiple components the same way as a single component, and you only need to call
You can call
Component.render() as often as you’d like in your Angular code (or elsewhere). This method will not lead to an API call every time; if a component has already been fetched once,
Component.render() will use that data instead of making another API call.
See the section on Component.render for more.