import {Component, Input, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
import {Config} from '../../config/config';
import {Refresher} from './refresher';
/**
* @private
*/
@Component({
selector: 'ion-refresher-content',
template:
'
' +
'
' +
'' +
'
' +
'
' +
'
' +
'' +
'
' +
'' +
'
' +
'
' +
'
',
host: {
'[attr.state]': 'r.state'
},
encapsulation: ViewEncapsulation.None,
})
export class RefresherContent {
/**
* @input {string} a static icon to display when you begin to pull down
*/
@Input() pullingIcon: string;
/**
* @input {string} the text you want to display when you begin to pull down
*/
@Input() pullingText: string;
/**
* @input {string} An animated SVG spinner that shows when refreshing begins
*/
@Input() refreshingSpinner: string;
/**
* @input {string} the text you want to display when performing a refresh
*/
@Input() refreshingText: string;
constructor(private r: Refresher, private _config: Config) {}
/**
* @private
*/
ngOnInit() {
if (!this.pullingIcon) {
this.pullingIcon = this._config.get('refresherPullingIcon', 'arrow-down');
}
if (!this.refreshingSpinner) {
this.refreshingSpinner = this._config.get('refresherRefreshingSpinner', this._config.get('spinner', 'ios'));
}
}
}