Code Monkey home page Code Monkey logo

demo-slide-panel's People

Contributors

angular-cli avatar antonmoiseev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

demo-slide-panel's Issues

Route change with slide animation?

Is there a posibility we can change route with this animation. Imagine a slide show with path param routes.

Eg:

https://localhost:2400/slide/slide1
https://ocalhost:2400/slide/slide2
https://localhost:2400/slide/slide3

toggle slide within component place in each side?

Hi,
thx for your article and this easy to use slide panel component.

I've wondered, how I could trigger the slide animation with click on a button inside of component which is place on one of the sides?

It would be like your youtube video. On left side you have the list with an edit icon. How you trigger the slide by click on this edit icon?

Thx & Regards

[Bug] Slide Panel messes up the Router

After visiting a page with the slide panel, when viewing all other pages, the router event is always the same.
Some more info:

I have this as a layout service to update the page title everytime I change page:

import { Injectable } from '@angular/core';
import { Router, NavigationStart, NavigationEnd, ActivatedRoute } from '@angular/router';

import { BehaviorSubject, Observable, of } from 'rxjs';
import { filter, mergeMap, startWith, map, switchMap } from 'rxjs/operators';

@Injectable()
export class LayoutService {
  private title$: BehaviorSubject<string> = new BehaviorSubject('');
  private loaderStatus$: BehaviorSubject<boolean> = new BehaviorSubject(false);
  private currentTheme$: BehaviorSubject<any> = new BehaviorSubject(null);
  private direction$: BehaviorSubject<string>;

  constructor(
    private router: Router,
    private activatedRoute: ActivatedRoute,
  ) {

    // Set direction from session if set.
    const sessionDirection = sessionStorage.getItem('portal-direction');
    const direction = sessionDirection && sessionDirection === 'rtl' ? 'rtl' : 'ltr';
    this.direction$ = new BehaviorSubject(direction);

    // Watch for router events to turn on/off the loader.
    this.router.events
      .subscribe((event: any) => {
        if (event instanceof NavigationStart) {
          this.loaderStatus$.next(true);
        } else if (event instanceof NavigationEnd) {
          this.loaderStatus$.next(false);
        }
      });

    // Watch for router events to set title using route data.
    this.router.events
      .pipe(
        filter(event => event instanceof NavigationEnd),
        startWith(this.activatedRoute),
        map(() => this.activatedRoute),
        map(route => {
          while (route.firstChild) {
            console.debug(route.firstChild);
            route = route.firstChild;
          }
          return route;
        }),
        filter(route => route.outlet === 'primary'),
        mergeMap(route => route.data)
      )
      .subscribe(data => {
        if (data['title']) {
          this.setTitle(data['title']);
        }
      });
  }

Now if I dont go to a page with the slide panel , the console.debug outputs the correct page, but once I enter a page with a slide panel component, the route outputted is always that slide panel page everytime I navigate to another page.

Example debug output:

Visiting initial page without slide panel (Home Page) component is HomePage():
screenshot from 2018-10-31 17 09 42

Visiting page with slide panel (Descriptions Page) component is DescriptionsPage():
screenshot from 2018-10-31 17 10 54

Visiting page without slide panel again (Home Page) component is DescriptionsPage() again:
screenshot from 2018-10-31 17 11 57

The url in the browser is updated correctly.

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.