Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

vaadin/base-starter-angular

Repository files navigation

Base Starter for Vaadin components with Angular

Prerequisites

First install yarn.

Build Setup

# install dependencies
$ yarn install

# serve with hot reload at localhost:4200
$ yarn start

# build for production with minification
$ yarn build

This project was generated with Angular CLI version 7.0.3.

To get more help check out the Angular CLI README.

Recreating this project

$ yarn global add @angular/cli
$ ng new hello-angular
$ cd hello-angular

$ yarn add @vaadin/vaadin-core

In src/app/app.module.ts:

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

...and inside @NgModule add:

schemas: [CUSTOM_ELEMENTS_SCHEMA],

In src/app/app.component.ts:

import '@vaadin/vaadin-button/vaadin-button.js';
import '@vaadin/vaadin-text-field/vaadin-text-field.js';

In src/app/app.component.html:

<vaadin-text-field #textField placeholder="Type Something"></vaadin-text-field>
<vaadin-button (click)='title=textField.value'>Click Me!</vaadin-button>
<h2>Hello {{title}}!</h2>