ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - alvarotrigo/angular-fullpage: Official Angular wrapper for fullPage.js https://alvarotrigo.com/angular-fullpage/
Official Angular wrapper for fullPage.js https://alvarotrigo.com/angular-fullpage/ - alvarotrigo/angular-fullpage
Visit Site

GitHub - alvarotrigo/angular-fullpage: Official Angular wrapper for fullPage.js https://alvarotrigo.com/angular-fullpage/

GitHub - alvarotrigo/angular-fullpage: Official Angular wrapper for fullPage.js https://alvarotrigo.com/angular-fullpage/

Angular fullpage

preview

Table of Contents

Installation

npm install @fullpage/angular-fullpage

This will install the Angular wrapper as well as fullpage.js library.

License

Non open source license

If you want to use angular-fullpage to develop non open sourced sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Which means, you won't have to change your whole application source code to an open source license. Purchase a Fullpage Commercial License.

Open source license

If you are creating an open source application under a license compatible with the GNU GPL license v3, you may use fullPage under the terms of the GPLv3.

The credit comments in the JavaScript and CSS files should be kept intact (even after combination or minification)

Read more about fullPage's license.

Usage

// app.module.ts
import { AngularFullpageModule } from '@fullpage/angular-fullpage';

@NgModule({
  imports: [
    BrowserModule,
    AppRoutingModule,
    AngularFullpageModule //*** added
  ]
})

You should import the fullpage.js stylesheet on your style.scss or component.scss:

/* styles.scss or app.component.scss */
@import url(~fullpage.js/dist/fullpage.min.css);
/* standard css */
@import '~fullpage.js/dist/fullpage.min.css';

Then use the directive on your component:

// app.component.ts
export class AppComponent {
  config: any;
  fullpageApi: any;

  constructor() {

    // for more details on config options please visit fullPage.js docs
    this.config = {

      // fullpage options
      licenseKey: 'YOUR LICENSE KEY HERE',
      anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
      menu: '#menu',

      // fullpage callbacks
      afterResize: () => {
        console.log("After resize");
      },
      afterLoad: (origin, destination, direction) => {
        console.log(origin.index);
      }
    };
  }

  getRef(fullPageRef) {
    this.fullpageApi = fullPageRef;
  }

}

You can optionally import types by

import { fullpageOptions, fullpageApi } from 'fullpage.js/dist/fullpage.extensions.min';
config: fullpageOptions;
fullpageApi: fullpageApi;

Example of HTML:

<!-- app.component.html -->
<div fullpage id="fullpage" [options]="config" (ref)="getRef($event)">
  <div class="section">Some section1</div>
	<div class="section" (click)="fullpageApi.moveSectionDown()">Some section2</div>
	<div class="section">
		<div class="slide">Slide 2.1</div>
		<div class="slide">Slide 2.2</div>
		<div class="slide">Slide 2.3</div>
	</div>
	<div class="section" (click)="fullpageApi.moveTo('secondPage', 2)">Some section4</div>
</div>

Use extensions

In order to make use of fullpage.js extension you'll have to add the extension file to angular.json.

For example, if we want to use the scrollHorizontally extension we will have to add the path to our fullpage.scrollHorizontally.min.js file on the scripts array:

"assets": [
  "src/favicon.ico",
  "src/assets"
],

"styles": [
  "src/styles.css"
],

"scripts": [
  "src/assets/fullpage.scrollHorizontally.min.js"
],

Then pass the required options to fullPage.js. In this case scrollHorizontally:true.

Use of scrollOverflow

Same procedure than the use of extensions detailed above.

"assets": [
  "src/favicon.ico",
  "src/assets"
],

"styles": [
  "src/styles.css"
],

"scripts": [
  "node_modules/fullpage.js/vendors/scrolloverflow.min.js"
],

Dynamic Changes

If you want to update fullPage.js with new changes in the DOM call the build() method after making those changes.

An example can be seen on the dynamic-changes example:

this.renderer.appendChild(this.fp_directive.nativeElement, section);
this.fullpageApi.build(); // <-- here

An example for *ngFor can be seen on the dynamic-changes-with-ngFor example:

<div fullpage id="fullpage" [options]="config" (ref)="getRef($event)">
    <div *ngFor="let section of sections" class="section">
		  <h1>Section {{section}}</h1>
	</div>
</div>

Examples

You can check some examples on the demo folder.

Contributing

Found an issue? Have an idea? Check out the Contributing guide and open a PR

Resources

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory