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" 


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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.