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
| /** | |
| * service that emulates http | |
| */ | |
| @Injectable() | |
| export class TodoService { | |
| readonly todos = [ | |
| {id: 1, text: 'todo1', categoryId: 1}, | |
| {id: 2, text: 'todo2', categoryId: 2}, | |
| {id: 3, text: 'todo3', categoryId: 1}, |
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 bredListRequest(resolve, reject) { | |
| const r = new XMLHttpRequest(); | |
| r.open('GET', 'https://api.github.com', true); | |
| r.onerror = (e) => reject(e, 'error'); | |
| r.onload = () => resolve(r.responseText); | |
| r.send(); | |
| } |
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
| const getIosVersion = () => { | |
| return [11, 3, 0]; | |
| if (isIos()) { | |
| const v = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); | |
| return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || '0', 10)]; | |
| } | |
| }; | |
| /** | |
| * iosVersionToCheck is : string like '11' or '11.0' or (11.1.0), number like 10 or 11 or 9 |
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 sleep(delay) { | |
| var start = new Date().getTime(); | |
| while (new Date().getTime() < start + delay); | |
| } |
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
| import { Component } from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import PropTypes from 'prop-types'; | |
| const modalRoot = document.getElementById('modal-root'); | |
| // Let's create a Modal component that is an abstraction around | |
| // the portal API. | |
| class InPortal extends Component { | |
| constructor(props) { |
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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "jsx": "react", | |
| "moduleResolution": "node", | |
| "emitDecoratorMetadata": true, | |
| "experimentalDecorators": true, | |
| "esModuleInterop": true, | |
| "allowSyntheticDefaultImports": true, | |
| "target": "es2015", | |
| "module": "esnext", |
OlderNewer