This service assumes that you followed the SSR receipt at ng-cli (i.e. you use the '@nguniversal/express-engine' package).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the core angular services. | |
import { Component } from "@angular/core"; | |
// ----------------------------------------------------------------------------------- // | |
// ----------------------------------------------------------------------------------- // | |
@Component({ | |
selector: "a-view", | |
styleUrls: [ "./a-view.component.less" ], | |
template: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def debounced_wrap(func): | |
@functools.wraps(func) | |
def wrapper(*args, **kwargs): | |
key = kwargs.pop("key") # it's required | |
call_count = kwargs.pop("call_count", 1) | |
count = cache.get(key, 1) | |
if count > call_count: | |
# someone called the function again before the this was executed | |
return None | |
# I'm the last call |
We're currently working on making it easier to add new field types to KeystoneJS as plugins.
In the meantime, if you'd like to work on your own field type, hopefully this guide will point you in the right direction.
Keystone fields require the following:
- a
{fieldType}.js
file in./lib/fieldTypes
that controls the field and encapsulates options support, underscore functions, validation and updating - the
{fieldType}.js
file needs to be included by./lib/fieldTypes/index.js