scroll-dropdown
TypeScript icon, indicating that this package has built-in type declarations

18.0.9 • Public • Published

Angular scroll-dropdown Example

This project demonstrates how to implement scroll-dropdown in an Angular application using the scroll-dropdown-angular-18 package.

Table of Contents

Installation

To install the scroll-dropdown-angular-18 package, run the following command: npm i scroll-dropdown-angular-18@latest

setup

interface ModalOptions {
  title?: string;
  body?: string;
  data?: any;
  size?: {
    minWidth?: string;
    width?: string;
    maxWidth?: string;
    minHeight?: string;
    height?: string;
    maxHeight?: string;
  };
}

import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { ModalOpenComponent, ModalService } from 'scroll-dropdown-angular-18';
import { HomeComponent } from './home/home.component';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [RouterOutlet,HomeComponent, ModalOpenComponent],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss',
  providers:[ModalService]
})
export class AppComponent {
  title = 'angular-tour-of-heroes';
  constructor(public modal:ModalService){}
  
  open(){
    this.modal.open(HomeComponent,{title:"kljaskldasdsa",body:"",data:{name:"Helloo"}})
  }
}

usage

<!-- Get Data HomeComponent used MODAL_DIALOG_DATA -->
import { Component, OnInit } from '@angular/core';
import { ModalService,DATA_MODAL_DIALOG_DATA } from 'scroll-dropdown-angular-14';

@Component({
  selector: 'app-home',
  standalone: true,
  imports: [],
  templateUrl: './home.component.html',
  styleUrl: './home.component.scss',
  providers: [ModalService]
})
export class HomeComponent implements OnInit {
  constructor(public modal: ModalService, @Inject(DATA_MODAL_DIALOG_DATA) public modalData: any) { }

  ngOnInit(): void {
    console.log(this.modalData, "DATA_MODAL_DIALOG_DATA")
  }
}

Live Demo

You can view and run the example project live on StackBlitz: link.

Readme

Keywords

none

Package Sidebar

Install

npm i scroll-dropdown

Weekly Downloads

15

Version

18.0.9

License

none

Unpacked Size

155 kB

Total Files

22

Last publish

Collaborators

  • yoursabhishekabhi7