From ce998f720511b0c509895c57fa58832c2e01b5f1 Mon Sep 17 00:00:00 2001 From: Zeb Burke-Conte Date: Tue, 12 Sep 2017 12:57:20 -0700 Subject: [PATCH] Update README usage instructions--fixes #9 --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0960f9..611f63a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,35 @@ This code based on Steve Papa's [angular2-autosize solution](https://github.com/ npm install ionic2-autosize ``` -## Use Example: +## Usage: + +In your `app.module.ts`, import `AutosizeModule`: + +```typescript +import { NgModule } from '@angular/core'; +import { IonicApp, IonicModule } from 'ionic-angular'; +import { MyApp } from './app/app.component'; +import { AutosizeModule } from 'ionic2-autosize'; + +@NgModule({ + declarations: [ + MyApp + ], + imports: [ + AutosizeModule, + IonicModule.forRoot(MyApp) + ], + bootstrap: [IonicApp], + entryComponents: [ + MyApp + ] +}) +export class AppModule {} +``` + +If you use page modules, import `AutosizeModule` to the page where you need it instead. + +In your component, add the `autosize` directive to an `ion-textarea`: ```typescript import {Component} from '@angular/core';