Skip to content

Instantly share code, notes, and snippets.

View vsavkin's full-sized avatar

Victor Savkin vsavkin

View GitHub Profile
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es2015",
"types": ["node", "jest"]
},
"include": ["**/*.ts"]
}
export * from './lib/greeting.element';
export class GreetingElement extends HTMLElement {
public static observedAttributes = ['title'];
attributeChangedCallback() {
this.innerHTML = `<h1>Welcome to ${this.title}!</h1>`;
}
}
customElements.define('happynrwl-greeting', GreetingElement);
import * as React from 'react';
import { Component } from 'react';
import './app.css';
export class App extends Component {
render() {
const title = 'reactapp';
return (
<div>
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { App } from './app/app';
ReactDOM.render(<App />, document.querySelector('happynrwl-root'));
<div style="text-align:center">
Welcome to {{title}}!
<img
width="300"
src="https://raw.githubusercontent.com/nrwl/nx/master/nx-logo.png"
/>
</div>
<p>This is an Angular app built with <a href="https://nx.dev">Nx</a>.</p>
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
var TodosComponent = /** @class */ (function () {
function TodosComponent(store) {
this.store = store;
this.todos = this.store.pipe(select('todos'));
}
TodosComponent.ngComponentDef = defineComponent({
type: TodosComponent,
selectors: [["todos-cmp"]],
factory: function TodosComponent_Factory(t) {
@Component({
selector: 'todos-cmp',
template: `
<div *ngFor="let t of todos|async">
{{t.description}}
</div>
`
})
class TodosComponent {
todos: Observable<Todo[]> = this.store.pipe(select('todos'));
@Component({
selector: 'todos-cmp',
template: `
<div *ngFor="let t of todos|async">
{{t.description}}
</div>
`,
features: [fromStore({todos: 'todos'})]
})
class TodosComponent {