layout | titlt |
---|---|
default |
Documentation to be categorized |
The following stuff is just added while developing some of the features so we dont forget to write it down. It will later be categorized in to different guides or pages.
lodash
const {lodash} = writer
console.log(lodash.isObject({})) // true
const {isObject, isEmpty} = writer.lodash
console.log(isObject({})) // true
console.log(isEmpty(null)) // true
moment.js
Moment.js is library for parsing, manipulating, validating and displaying dates and time.
const {moment} = writer.moment
moment().format() //"2016-10-31T15:14:37+01:00"
Since version 2 of Newspilot writer the label system have had a make over.
The plugin itself is now responsible for providing its own label.
This is made in the package.
config.addLabel('my-label-key', {
en: 'The english label',
sv: 'Den svenska titeln'
})
To later retrieve the label in your component just use getLabel
render($$) {
return $$('div').append(this.getLabel('my-label-key'))
}