whatsthatitspat / ionic-shrinkage Goto Github PK
View Code? Open in Web Editor NEWDirective for Ionic 2 to cause headers to shrink & reveal, in parallactic fashion, based on user scrolling.
License: ISC License
Directive for Ionic 2 to cause headers to shrink & reveal, in parallactic fashion, based on user scrolling.
License: ISC License
you said you would update this when ionic 2.0.0 is released.
It was released.
I would appreciate when you would update this.
In testing this out in my own app, I found some errors that I was able to correct and one I couldn't.
With Ionic 2.1.0-beta.3, the following changes had to be made:
import { Component, Directive, ViewChild } from '@angular/core';
//import { Shrinkage } from 'ionic-shrinkage';
import * as Shrinkage from 'ionic-shrinkage';
@component({
selector: 'page-home',
templateUrl: 'home.html'
//directives: [ Shrinkage ]
})
@directive({
selector: '[Shrinkage]' // <-- [my-dir] because it's an attribute
})
The only error left is this:
11:09:48] typescript: C:/Users/Thomas/ionic2/app/src/pages/home/home.ts, line: 24
Argument of type 'typeof "C:/Users/Thomas/ionic2/app/node_modules/ionic-shrinkage/dist/index"'
is not assignable to parameter of type 'string | Function | Type<any>'. Type 'typeof "C:/Users/Thomas/ionic2/app/node_modules/ionic-shrinkage/dist/index"'
is not assignable to type 'Type<any>'. Property 'apply' is missing in type 'typeof "C:/Users/Thomas/ionic2/app/node_modules/ionic-shrinkage/dist/index"'.
L23: // Necessary for the change() method below
L24: @ViewChild(Shrinkage) shrinkage;
[11:09:48] transpile failed
export class HomePage {
conferenceDate = '2047-05-17';
// We bind content to the shrinkage attribute in the HTML template
@ViewChild(Content) content: Content;
// Necessary for the change() method below
**@ViewChild(Shrinkage) shrinkage;**// <-- line 24
constructor(public popoverCtrl: PopoverController) { }
presentPopover(event) {
let popover = this.popoverCtrl.create(PopoverPage);
popover.present({ ev: event });
}
// If you use Structural Directives to add or remove items in the header,
// you'll have to call resize() on both content and the shrinkage directive.
change(e) {
this.content.resize();
this.shrinkage.resize();
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.