chore: restore temporarily deprecated apis (#7407)

This commit is contained in:
Manol Donev
2019-06-26 12:58:23 +03:00
committed by Dimitar Topuzov
parent 872207515a
commit 92370279d8
2 changed files with 20 additions and 1 deletions

View File

@@ -865,6 +865,24 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
this.addPseudoClass(state);
}
/**
* @deprecated
*
* This used to be the way to set attribute values in early {N} versions.
* Now attributes are expected to be set as plain properties on the view instances.
*/
public _applyXmlAttribute(attribute: string, value: string): boolean {
console.log("ViewBase._applyXmlAttribute(...) is deprecated; set attributes as plain properties instead");
if (attribute === "style" || attribute === "rows" || attribute === "columns" || attribute === "fontAttributes") {
this[attribute] = value;
return true;
}
return false;
}
public setInlineStyle(style: string): void {
if (typeof style !== "string") {
throw new Error("Parameter should be valid CSS string!");

View File

@@ -50,7 +50,8 @@ Object.assign(layout, layoutCommon);
export module ios {
// TODO: remove for NativeScript 7.0
export function _getter<T>(_this: any, property: T | { (): T }): T {
export function getter<T>(_this: any, property: T | { (): T }): T {
console.log("utils.ios.getter() is deprecated; use the respective native property instead");
if (typeof property === "function") {
return (<{ (): T }>property).call(_this);
} else {