jlmakes / scrollreveal

Animate elements as they scroll into view.
https://scrollrevealjs.org/
22.4k stars 2.25k forks source link

ScrollReveal is not defined #314

Closed Sonntagskind closed 7 years ago

Sonntagskind commented 7 years ago

I installed npm scrollreveal and ng2-scrollreveal for my Angular2 app. The app consists of three sections: Home, About, Contact I want the About section stuff to be revealed, then following the official guide I add to my div class "item" and set the attribute [ngsReveal]="{ reset: true}"

When I click either Home or Contact sections (where's no content for revealing) console shows no errors, but when I click About section (where's my content to be revealed on scroll) console shows me following errors

screenshot 2016-11-17 23 07 14

My app.module.ts file: `import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { NgsRevealModule } from 'ng2-scrollreveal'; import { AppComponent } from './app.component';

import { AppRoutingModule, routingComponents } from './app.routing';

@NgModule({ declarations: [ AppComponent, routingComponents ], imports: [ NgsRevealModule.forRoot(), BrowserModule, AppRoutingModule ], bootstrap: [ AppComponent ] }) export class AppModule { }`

My system.config.js file `import { Component } from '@angular/core'; import { NgsRevealModule } from 'ng2-scrollreveal';

@Component({ selector: 'about-block', providers: [ NgsRevealModule ], templateUrl: 'app/about.component.html' })

export class AboutComponent {}`

My about.component.html file `(function (global) { System.config({ paths: { 'npm:': 'node_modules/' },

map: {
  app: 'app',

  '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
  '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
  '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
  '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
  '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
  '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
  '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
  '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',

  'ng2-scrollreveal': 'npm:ng2-scrollreveal/bundles/ng2-scrollreveal.min.js',
  'rxjs': 'npm:rxjs',
  'angular-in-memory-web-api': 'npm:angular-in-memory-web-api'
},

packages: {
  app: {
    main: './main.js',
    defaultExtension: 'js'
  },
  rxjs: {
    defaultExtension: 'js'
  },
  'angular-in-memory-web-api': {
    main: './index.js',
    defaultExtension: 'js'
  }
}

}); })(this);`

P.S. Earlier there was an error about ng-2 scrollreveal too, but I manually updated the system.config file inserting the line: 'ng2-scrollreveal': 'npm:ng2-scrollreveal/bundles/ng2-scrollreveal.min.js',

Doing the same with scrollreveal doesn't work and console keeps throwing the same error. Please, help figure out what's been done wrong.

jlmakes commented 7 years ago

I know this library is using ScrollReveal as a dependency, but unfortunately I don't have much to offer you @Sonntagskind. I'm not the author, nor am I very experienced with Angular 2.

I recommend opening your issue here instead.

🐝

Sonntagskind commented 7 years ago

@jlmakes Thanks, I will.