O'Reilly logo

NativeScript for Angular Mobile Development by Nathanael J. Anderson, Nathan Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrate a custom NativeScript view into our Angular app

To use our NativeScript Waveform view within Angular, we need to first register it. You can do this in the root module, root app component, or another place that is initialized at boot time (usually, not in a lazy-loaded module). To be tidy, we will register it within SharedModule in the same directory, so add the following in app/modules/shared/shared.module.ts:

...// register nativescript custom componentsimport { registerElement } from 'nativescript-angular/element-registry';import { Waveform } from './native/waveform';registerElement('Waveform', () => Waveform);...@NgModule({...export class SharedModule {...

The registerElement method allows us to define the name of the Component ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required