How to use the nativescript-angular/element-registry.isKnownView function in nativescript-angular

To help you get started, we’ve selected a few nativescript-angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PeterStaev / nativescript-masked-text-field / angular / index.ts View on Github external
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
***************************************************************************** */
import { NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";

import { isKnownView, registerElement } from "nativescript-angular/element-registry";
import { NativeScriptFormsModule } from "nativescript-angular/forms";

import { MaskedTextValueAccessor } from "./masked-text-value-accessor";

if (!isKnownView("MaskedTextField")) {
    registerElement("MaskedTextField", () => require("../masked-text-field").MaskedTextField);
}

@NgModule({
    declarations: [
        MaskedTextValueAccessor
    ],
    providers: [],
    imports: [
        FormsModule,
        NativeScriptFormsModule
    ],
    exports: [
        FormsModule,
        MaskedTextValueAccessor
    ]
github PeterStaev / NativeScript-Grid-View / angular / grid-view-comp.ts View on Github external
export class GridViewComponent extends TemplatedItemsComponent {
    public get nativeElement(): GridView {
        return this.templatedItemsView;
    }

    protected templatedItemsView: GridView;

    constructor(
        _elementRef: ElementRef,
        _iterableDiffers: IterableDiffers) {
        super(_elementRef, _iterableDiffers);
        
    }
}

if (!isKnownView("GridView")) {
    registerElement("GridView", () => GridView);
}