ngx-material-keyboard / core

Onscreen virtual keyboard for Angular ≥ 5 (https://angular.io/) using Angular Material (https://material.angular.io/).
https://ngx-material-keyboard.github.io/core/
98 stars 120 forks source link

Property '_animationState' is private and only accessible within class 'MatKeyboardContainerComponent' #96

Open alxpsr opened 5 years ago

alxpsr commented 5 years ago

Package version: 0.1.1

If set "fullTemplateCheck": "true" in tsconfig.json i will got an error Property '_animationState' is private and only accessible within class 'MatKeyboardContainerComponent'

Problem is here:

// ngx-material-keyboard\src\core\src\components\keyboard-container\keyboard-container.component.ts

@HostBinding('@state')
private _animationState: KeyboardAnimationState = KeyboardAnimationState.Void;

This HostBinder used outside of MatKeyboardContainerComponent

stebigs commented 4 years ago

Hello everyone, same problem here. I am using angular 8. Any idea on how to fix it?

alxpsr commented 4 years ago

apply this patch

const fs = require('fs');
const path = require('path');
const PATH_TO_FILE = path.join(__dirname, '../../node_modules/@ngx-material-keyboard/core/components/keyboard-container/keyboard-container.component.d.ts');

fs.readFile(PATH_TO_FILE, 'utf8', (err, data) => {
    if (err) {
        console.error(err);
        return;
    }

    const result = data.replace('private _animationState', 'public _animationState');

    fs.writeFile(PATH_TO_FILE, result, (err) => {
        if (err) {
            console.error('PATCH FAIL', err);
            return;
        }

        console.info('PATCH SUCCESS');
    });
})
mgierw commented 4 years ago

Is there a chance that this problem will be fixed in lib code? Identical problem is with methods _showKeyboard and _hideKeyboard.

Thx in advance.