Giter Club home page Giter Club logo

ngx-spreadmodal's Introduction

NgxSpreadmodal

If you need a modal that takes up whole screen, this modal does that with some neat extra features.

DEMO

Use it like this

In your component HTML file

<ngx-spreadmodal #spread>
Modal content goes here
</ngx-spreadmodal>


<button (click)="openModal()">Open Modal</button>
<button (click)="closeModal()">Close Modal</button>

In your component class

import { Component, ViewChild} from '@angular/core';
import { NgxSpreadmodalComponent } from 'ngx-spreadmodal';

export class AppComponent {
  
  @ViewChild('spread') spread:NgxSpreadmodalComponent;

  openModal(){
    this.spread.openModal();
  }

  closeModal(){
    this.spread.closeModal();
  }
  }

To act upon modal animation completion use promise.

  openModal(){
    this.spread.openModal().then(() =>{
      console.log('modal opened');
    });
  }

  closeModal(){
    this.spread.closeModal().then(()=>{
      console.log('modal closed');
    });
  }

ngx-spreadmodal's People

Contributors

jkrajinovic avatar

Watchers

James Cloos avatar  avatar

ngx-spreadmodal's Issues

Add options

In order to enable developers to configure modal,
configuration should be provided as element attributes
as well as component.

  • close button should be optional

  • animation duration should be optional

  • background color should be configurable

  • background image option should be available

Add promises

Promises should be added to openModal() and closeModal() functions
to enable reactions when model fully closed or fully opened.

Add animations tracker strategies

In order to be able to choose between multiple ways of tracking is modal animation ended.
AnimationsTracker should provide choice between these strategies:

  1. setTimeout strategy (returns promise on setTimeouts)
  2. event (returns promise on event "transitionend").
  3. angular animations strategy (returns promise on angular callbacks)

Create a demo page

Demo page should be created for displaying modal functions on github pages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.