Skip to content
Snippets Groups Projects
Commit ddc6d887 authored by chris's avatar chris
Browse files

new service

parent 835e39de
No related branches found
No related tags found
1 merge request!511Numerical answer
import { Service } from 'wax-prosemirror-core';
import NumericalAnswerContainerNode from './schema/NumericalAnswerContainerNode';
import './numericalAnswer.css';
class NumericalAnswerService extends Service {
register() {
this.container.bind('').to();
const createNode = this.container.get('CreateNode');
const addPortal = this.container.get('AddPortal');
}
dependencies = [];
}
export default NumericalAnswerService;
const NumericalAnswerContainerNode = {
attrs: {
id: { default: '' },
class: { default: 'numerical-answer' },
feedback: { default: '' },
},
group: 'block questions',
atom: true,
content: 'block+',
parseDOM: [
{
tag: 'div.numerical-answer',
getAttrs(dom) {
return {
id: dom.getAttribute('id'),
class: dom.getAttribute('class'),
feedback: dom.getAttribute('feedback'),
};
},
},
],
toDOM(node) {
return ['div', node.attrs, 0];
},
};
export default NumericalAnswerContainerNode;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment