2017-04-24 4 views
0

角度2でクリックするとポップアップ画面が必要です。ポップアップ画面には異なるタブとフォームが含まれていますが、angular2-modalで試しましたが、カスタムフォームの作成をサポートするかどうか。オンクリックで角度2のポップアップフォーム

angle2-modelがカスタムフォームをサポートしている場合その他の方法自分の仕事を達成するための他のパッケージがありますか?

マイコード:あなたがテンプレートにrefまたはカスタムのモーダル・コンポーネントを提供することができます見ての通り

/** 
    * Opens a modal window inside an existing component. 
    * @param content The content to display, either string, template ref 
or a component. 
    * @param config Additional settings. 
    * @returns {Promise<DialogRef>} 
    */ 
    open(content: ContainerContent, config?: OverlayConfig): 
    Promise<DialogRef<any>> {... } 

***users.component.html*** 

<input type="checkbox" name="scheduler2" (click)="helpWindow($event)"> 


***users.component.ts*** 

helpWindow(event) { 
    this.modal.alert() 
     .size('lg') 
     .isBlocking(true) 
     .keyboard(27) 
     .showClose(true) 
     .title('A simple Alert style modal window') 
     .body(` 
      <h4>Alert is a classic (title/body/footer) 1 button modal window that 
      does not block.</h4> 
      <b>Configuration:</b> 
      <ul> 
       <input type="text" name="text" /> 
      </ul>`) 
     .open(); 
    } 

答えて

0

これはangular2モーダルopen関数です。 詳細については、bootstrap-demo-pageを参照してください。

+0

私はそれを使い始めるとうまくいきます。私は、ポップアップの幅を減らす方法や増加させる方法を少し質問しています。 – suresh

0

angle2素材を使用できます。それは、任意のコンポーネントを注入することができ、そのコンポーネントがそのモデルに現れる素晴らしいダイアログを提供します。また、afterClose(サブスクライバ)のような素晴らしい機能がたくさんあります。子コンポーネントにデータを渡すことができます。