Skip to content

Instantly share code, notes, and snippets.

@cdcarson
Last active August 5, 2017 18:01
Show Gist options
  • Save cdcarson/2ddf375020be2955dfe2bc1490e43d4d to your computer and use it in GitHub Desktop.
Save cdcarson/2ddf375020be2955dfe2bc1490e43d4d to your computer and use it in GitHub Desktop.
Modal Examples
import { Component } from '@angular/core';
import { NzbModal } from 'nowzoo-angular-bootstrap-lite';
/**** A sample component we use for modal content *****/
@Component({
selector: 'app-example-modal-content',
template:`
<div class="modal-header">
<h5 class="modal-title">Enter Your Name</h5>
<button type="button" class="close" (click)="modal.dismiss('header dismiss button clicked')" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="example-modal-content-name">Name</label>
<input type="text" [(ngModel)]="name" class="form-control">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
(click)="modal.dismiss('footer cancel button clicked')">Cancel</button>
<button type="button" class="btn btn-primary"
(click)="modal.close(name)">Save</button>
</div>
`
})
export class ExampleModalContentComponent {
name: string;
constructor( public modal: NzbModal ) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment