This file contains hidden or 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
@Scope("singleton") | |
public class InternalDatabase { | |
private List<Transaction> memory; | |
public InternalDatabase() { | |
if (this.memory == null) { | |
this.memory = new ArrayList<>(); | |
} | |
} |
This file contains hidden or 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
CMS.registerEditorComponent({ | |
// Internal id of the component | |
id: "figure", | |
// Visible label | |
label: "Figure", | |
// Fields the user need to fill out when adding an instance of the component | |
fields: [ | |
{name: 'src', label: 'Image', widget: 'image'}, | |
{name: 'caption', label: 'Caption', widget: 'string'}, | |
{name: 'link', label: 'Link', widget: 'string'}, |
This file contains hidden or 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
<template> | |
<div id="myComponent"> | |
<Counter /> | |
<span v-if="reading">Hello reader !</span> | |
</div> | |
</template> | |
<script> | |
import Counter from "@/components/Counter"; |
This file contains hidden or 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
class MyComponent extends React.Component { | |
render() { | |
return(<div />) | |
} | |
} |
This file contains hidden or 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
Vue.component({ | |
template: `<div></div>` | |
}) |
This file contains hidden or 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
return ( | |
<div> | |
{students.map(student => <p>{student}</p>)} | |
</div> | |
) |
This file contains hidden or 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
<div> | |
<p v-for="student in students">{{ student }}</p> | |
</div> |
This file contains hidden or 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
class MyComponent extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
counter: 0 | |
} | |
} | |
render() { | |
return(<div/>) |
This file contains hidden or 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
function MyComponent() { | |
const [counter, setCounter] = useState(0) | |
return(<div />) | |
} |
This file contains hidden or 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
class Shipment | |
def prepare_for_delivery | |
@message = 'Shipment is prepared for delivery' | |
end | |
def tracking_code(code) | |
@tracking_code = code | |
end |