Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. import { Component, NgModule } from '@angular/core';
  2. import { BrowserModule } from '@angular/platform-browser';
  3. import { FormsModule, ReactiveFormsModule } from '@angular/forms';
  4. import { JsonpModule } from '@angular/http';
  5. import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
  6. import { NgbdPopoverTplcontent } from './popover-tplcontent';
  7.  
  8. @Component({
  9. selector: 'my-app',
  10. template: `
  11. <div class="container-fluid">
  12.  
  13. <hr>
  14. <p>
  15. This is a demo plnkr forked from the <strong>ng-bootstrap</strong> project: Angular powered Bootstrap.
  16. Visit <a href="https://ng-bootstrap.github.io/" target="_blank">https://ng-bootstrap.github.io</a> for more widgets and demos.
  17. </p>
  18. <hr>
  19.  
  20. <ngbd-popover-tplcontent></ngbd-popover-tplcontent>
  21. </div>
  22. `
  23. })
  24. export class App {
  25. }
  26.  
  27. @NgModule({
  28. imports: [BrowserModule, FormsModule, ReactiveFormsModule, JsonpModule, NgbModule.forRoot()],
  29. declarations: [App, NgbdPopoverTplcontent]
  30. bootstrap: [App]
  31. })
  32. export class AppModule {}
  33.  
  34. <p>
  35. Popovers can contain any arbitrary HTML, Angular bindings and even directives!
  36. Simply enclose desired content in a <code><ng-template></code> element.
  37. </p>
  38.  
  39. <ng-template #popContent>Hello, <b>{{name}}</b>!</ng-template>
  40. <button type="button" class="btn btn-secondary" [ngbPopover]="popContent" popoverTitle="Fancy content" placement="right">
  41. I've got markup and bindings in my popover!
  42. </button>
  43.  
  44. [placement]="getPlacement()"
  45.  
  46. public getPlacement(): string {
  47. return window.innerHeight <= 600 ? 'top' : 'right';
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement