question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular 2 and Slideout

See original GitHub issue

Hi,

I have tried to use slideout with angular2 and I have some difficulties and errors.

I have install slideout by npm install. Add slideout in typings (typings install…). Then, in my page.component.ts, import slideout

import 'slideout';

then in the ngOnInit() :

this.slideout = new Slideout( { 'panel': this.element.nativeElement.querySelector('main'), 'menu': this.element.nativeElement.querySelector('nav'), 'padding': 256, 'tolerance': 70 });

Next, in the page.component.scss, add class in the css :

`.slideout-menu { position: fixed; left: 0; top: 0; bottom: 0; right: 0; z-index: 0; width: 256px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; }

  .slideout-panel {
    position:relative;
    z-index: 1;
    will-change: transform;
}

  .slideout-open,
  .slideout-open body,
  .slideout-open .slideout-panel {
    overflow: hidden;
}

  .slideout-open .slideout-menu {
    display: block;
}`

I save all, compile, and access the page in my browser chrome. I have the following error :

EXCEPTION: Slideout is not defined

Do I miss something here ? Is slideout compatible with angular2 ?

Thanks for any help.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pazguillecommented, Oct 5, 2016

Hi @gillouneos, Could you try to import the module like this?

import Slideout from 'slideout';
0reactions
mhmodsncommented, Nov 28, 2016

Hello, I am using Webpack Module Bundler and I have added this plugin to the plugins, and Now it is working with me 😃

 new webpack.ProvidePlugin({
   Slideout: "slideout"
 })

As well as in the component.ts

import 'slideout';
declare var Slideout:any;

I think there is maybe something in SystemJS to make like what I made in Webpack

Read more comments on GitHub >

github_iconTop Results From Across the Web

slide-in slide-out functionality using Angular2 animation ...
I am trying to build a slide-in slide-out type of slider using angular animation but I'm facing some issues like.
Read more >
Angular 2 example for slide out
app.component.html' }) export class AppComponent { title = 'Slideout Example'; } import { NgModule } from '@angular/core'; import { BrowserModule } from ...
Read more >
DevExtreme Slideout: Angular Components by DevExpress
The SlideOut component is a classic slide-out menu paired with a view. A user opens the menu by swiping away the view. This...
Read more >
Angular Slideout Panel
Take a look at the docs for the API. Follow these steps to get started. 1) Install via Bower bower install angular-slideout-panel --save....
Read more >
angular-slideout
angular -slideout. 1.0.1 • Public • Published 6 years ago. Readme · Explore BETA · 1 Dependency · 0 Dependents · 2 Versions ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found