Creating SlimSliderDirective for iOS and Android native API modifications

We still have a directive to create for that slim-slider attribute we had on Slider:

<Slider #slider slim-slider minValue="0" [maxValue]="duration" 

class="slider"></Slider>

We are going to create platform-specific directives, since we will tap into the slider's actual native API on iOS and Android to disable user interaction and hide the thumb for a seamless appearance.

For iOS, create app/modules/player/directives/slider.directive.ios.ts with the following:

import { Directive, ElementRef } from '@angular/core';@Directive({ selector: '[slim-

slider]'})export class SlimSliderDirective {  constructor(private el: ElementRef) { }   

ngOnInit() { let uiSlider = <UISlider>this.el.nativeElement.ios; ...

Get NativeScript for Angular Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.