Property 'lockSwipeToNext' does not exist on type 'Slides'


#1

According to the documentation this method should be available for me to use, however it doesnt seem to be. Am I missing an import or is something else wrong?


#2

This is what I used in the constructor in order to access this function.

    this.slideOptions = { 
      onlyExternal: false,
      onInit: (slides: any) =>
        this.slider = slides
    }

#3

Any chance you can go into more detail about where lockSwipeToNext is used in your constructor?


#4

This is my silder:
<ion-slides [options]="slideOptions">

I have added this property:
slideOptions: any;
In my constructor this:

   'this.slideOptions = { 
      onlyExternal: false,
       onInit: (slides: any) =>
          this.slider = slides
     }'

Then I can use this in my functions
this.slider.lockSwipeToPrev();


#5

Thank you!!! Got it to work with this


#6

You can also use this:

<ion-slides [options]="{onlyExternal: true}">

:wink:


#7

The HTML

<ion-header>
  <ion-navbar>
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>
      Signup
    </ion-title>
  </ion-navbar>
</ion-header>
<ion-content padding id="page8" scroll="false">
	<ion-slides [options]="slideOptions" pager>
		<ion-slide>
			<div class="box blue"><h1>BLUE</h1></div>
		</ion-slide>
		<ion-slide>
			<div class="box yellow"><h1>YELLOW</h1></div>
		</ion-slide>
		<ion-slide>
			<div class="box pink"><h1>PINK</h1></div>
		</ion-slide>
	</ion-slides>
</ion-content>

I get the following error when I am trying to add the [options] in the ion-slides tag.

Can’t bind to ‘options’ since it isn’t a known property of ‘ion-slides’.

  1. If ‘ion-slides’ is an Angular component and it has ‘options’ input, then verify that it is part of this module.
  2. If ‘ion-slides’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.
  3. To allow any property add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas’ of this component. ("


    <ion-slides [ERROR ->][options]=“slideOptions” pager>

What am I doing wrong?