-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed defaulting rows and columns to 1 causing layout issue
demo: added custom template demo, closes #1
- Loading branch information
1 parent
cc1d653
commit 3b74f98
Showing
10 changed files
with
80 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
demo/src/app/components/mentions/demos/custom-template/mentions-custom-template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div class="basic-example"> | ||
<ng-mentions | ||
[mentions]="model.mentions" | ||
formClass="form-control" | ||
rows="5" | ||
cols="35" | ||
[(ngModel)]="model.value" | ||
placeholder="Type text here..." | ||
> | ||
<ng-template let-item="item"> | ||
<span>{{item.id}}: {{item.display}} ({{item.type}})</span> | ||
</ng-template> | ||
</ng-mentions> | ||
</div> | ||
<pre class="my-2">{{model | json}}</pre> |
33 changes: 33 additions & 0 deletions
33
demo/src/app/components/mentions/demos/custom-template/mentions-custom-template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nthd-mentions-custom-template', | ||
templateUrl: './mentions-custom-template.html' | ||
}) | ||
export class NthdMentionsCustomTemplate { | ||
model: any = { | ||
value: '', | ||
mentions: [ | ||
{ | ||
display: 'Dave', | ||
id: 1, | ||
type: 'contact' | ||
}, | ||
{ | ||
display: 'Bob Ross', | ||
id: 2, | ||
type: 'contact' | ||
}, | ||
{ | ||
display: 'Carl', | ||
id: 3, | ||
type: 'contact' | ||
}, | ||
{ | ||
display: 'Sue', | ||
id: 4, | ||
type: 'contact' | ||
}, | ||
] | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters