Skip to content

Instantly share code, notes, and snippets.

View vsavkin's full-sized avatar

Victor Savkin vsavkin

View GitHub Profile
nx serve tickets
nx test tickets
nx lint tickets
nx build tickets
nx e2e tickets-e2e
<workspace name>
├── apps
│ ├── tickets
│ │ ├── src
│ │ │ ├── app
│ │ │ ├── assets
│ │ │ ├── environments
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── main.ts
@NgModule({
imports: [BrowserModule],
declarations: [GreetingComponent],
entryComponents: [GreetingComponent],
bootstrap: []
})
export class UiModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const element = createCustomElement(GreetingComponent, { injector: this.injector });
@Component({
template: `
<h1>Welcome to {{title}}!</h1>
`
})
export class GreetingComponent {
@Input() title: string;
}
import * as React from 'react';
import { Component } from 'react';
import './app.css';
export class App extends Component {
render() {
const title = 'reactapp';
return (
<div>
declare namespace JSX {
interface IntrinsicElements {
[elemName: string]: any;
}
}
import '@happynrwl/ui';
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">
<happynrwl-greeting [title]="title"></happynrwl-greeting>
<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>
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
providers: [],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
bootstrap: [AppComponent]
})
export class AppModule {}
import '@happynrwl/ui'; // <-- the new library
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) {