Skip to content

Commit

Permalink
docs(Add Example): Added Example for the directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Habenicht authored and Daniel Habenicht committed Aug 6, 2018
1 parent 5bfd6c3 commit b5dc1c0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 23 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you want to have another Property, please open up an issue or even better pro
2. Import in app.module.ts:

```typescript
import { NgxVcardModule } from "ngx-vcard";
import { NgxVcardModule } from 'ngx-vcard';
@NgModule({
imports: [NgxVcardModule]
Expand All @@ -30,8 +30,40 @@ If you want to have another Property, please open up an issue or even better pro
## How to use
### Use as Directive
[Look here for a Stackblitz Example](https://stackblitz.com/github/DanielHabenicht/ngx-vcard)
```typescript
/* example.component.ts */
import { Component } from '@angular/core';
import { VCard } from 'ngx-vcard';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
public vCard: VCard = {
name: {
firstNames: 'John',
lastNames: 'Doe'
}
};
}
```
```html
<!-- example.component.html -->
<div>
<button id="downloadButton" [vcdDownloadVCard]="vCard">Download VCard!</button>
</div>
```
### Use as Formatter
- TODO: Add .ts File example
- TODO: Add directive example
## Mentions
Expand Down
36 changes: 15 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"core-js": "^2.5.4",
"ngx-vcard": "^1.0.2",
"rxjs": "^6.0.0",
"zone.js": "~0.8.26"
},
Expand Down

0 comments on commit b5dc1c0

Please sign in to comment.