GithubHelp home page GithubHelp logo

joshdsommer / nativescript-ngx-slides Goto Github PK

View Code? Open in Web Editor NEW
43.0 2.0 34.0 3.05 MB

A NativeScript + Angular module for to add a slides component to your mobile app

License: Other

HTML 2.75% TypeScript 70.67% CSS 4.59% JavaScript 22.00%
nativescript-slides nativescript-plugin angular image-carousel slider-plugin slide

nativescript-ngx-slides's Introduction

NativeScript + Angular Slides for iOS and Android

NPM version Downloads Twitter Follow

Intro slides example:

Nativescript Slides. Click to Play

Image carousel example:

Nativescript Slides. Click to Play

videos are from the NativeScript Slides plugin. all features may not be implemented yet.

videos by Brad Martin

Example Usage:

import { SlidesModule } from "nativescript-ngx-slides";

import { AppComponent } from "./app.component";

@NgModule({
  declarations: [AppComponent],
  bootstrap: [AppComponent],
  imports: [NativeScriptModule, SlidesModule],
  schemas: [NO_ERRORS_SCHEMA]
})
export class AppModule {}

XML

<slides>
    <slide class="slide-1">
        <Label text="This is Panel 1"></Label>
    </slide>
    <slide class="slide-2">
        <Label text="This is Panel 2"></Label>
    </slide>
    <slide class="slide-3">
        <Label text="This is Panel 3"></Label>
    </slide>
    <slide class="slide-4">
        <Label text="This is Panel 4"></Label>
    </slide>
    <slide class="slide-5">
        <Label text="This is Panel 5"></Label>
    </slide>
</slides>

CSS

place this in the app.css file in the root of your project.

.slide-1 {
  background-color: darkslateblue;
}

.slide-2 {
  background-color: darkcyan;
}
.slide-3 {
  background-color: darkgreen;
}

.slide-4 {
  background-color: darkgoldenrod;
}
.slide-5 {
  background-color: darkslategray;
}
label {
  text-align: center;
  width: 100%;
  font-size: 35;
  margin-top: 35;
  color: #fff;
}

Great for Intros/Tutorials to Image Carousels.

This very much a work in progress. Please feel free to contribute.

Attributes for SlideContainer

  • loop : boolean - If true will cause the slide to be an endless loop. The suggested use case would be for a Image Carousel or something of that nature.

  • pageIndicators : boolean - If true adds indicator dots to the bottom of your slides.

  • swipeSpeed : number - Determines the speed of swipe. The bigger swipeSpeed property is, the faster you swipe the slides. Default value is 3. Try changing it to 15 to see the result.

Indicators

If the property pageIndicators is true you won't see the page indicators anymore as of 2.0.0 right away. there are two css classes exposed that you can setup however you like for active and inactive indicators. below is an example for semi translucent dots.

.slide-indicator-inactive {
  background-color: #fff;
  opacity: 0.4;
  width: 10;
  height: 10;
  margin-left: 2.5;
  margin-right: 2.5;
  margin-top: 0;
  border-radius: 5;
}

.slide-indicator-active {
  background-color: #fff;
  opacity: 0.9;
  width: 10;
  height: 10;
  margin-left: 2.5;
  margin-right: 2.5;
  margin-top: 0;
  border-radius: 5;
}

Plugin Development Work Flow:

  • Clone repository to your machine.
  • Run npm install to prepare the project
  • Run and deploy to your device or emulator with npm run android or npm run ios
  • Build a ngPackagr version with npm run build

Known issues

  • Does not work well inside of ScrollView or TabViews.

Contributors

TheOriginalJosh dobjek EddyVerbruggen Vahid Najafi Marco Mantovani
Josh Sommer dobjek Eddy Verbruggen Vahid Najafi Codeback Software

Contributing guidelines

Contributing guidelines

License

MIT

for {N} version 2.0.0+

nativescript-ngx-slides's People

Contributors

codeback avatar dobjek avatar eddyverbruggen avatar irman avatar jafaircl avatar joshdsommer avatar theoriginaljosh avatar vahidvdn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nativescript-ngx-slides's Issues

Error: moduleId should be a string in "SlidesComponent"

I install this plugin and build my app with --bundle option.
A build error is thrown out:

JS:ERROR Error: Uncaught (in promise): Error: moduleId should be a string in "SlidesComponent". See https://goo.gl/wIDDiL for more information.
JS: If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.
JS: Error: moduleId should be a string in "SlidesComponent". See https://goo.gl/wIDDiL for more information.
JS: If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.

pageIndicators not showing

Thanks for the plugin, I can't get the pageIndicators to show.

I followed the readme:

Indicators

If the property pageIndicators is true you won't see the page indicators anymore as of 2.0.0 right away. there are two css classes exposed that you can setup however you like for active and inactive indicators. below is an example for semi translucent dots.

.slide-indicator-inactive{
    background-color: #fff;
    opacity : 0.4;
    width : 10;
    height : 10;
    margin-left : 2.5;
    margin-right : 2.5;
    margin-top : 0;
    border-radius : 5;
}

.slide-indicator-active{
    background-color: #fff;
    opacity : 0.9;
    width : 10;
    height : 10;
    margin-left : 2.5;
    margin-right : 2.5;
    margin-top : 0;
    border-radius : 5;
}

I simply copied and pasted those into my slide.component.css file (which holds other classes for the component).

The other classes do pick up, I have tried setting the page bg to white or dark colours, but I still can't see any dots.

slide.component.html

<GridLayout columns="*" rows="*, auto" class="slide-bg"> <StackLayout col="0" row="0"> <slides [loop]="false" [pageIndicators]="true" class="slide-bg"> <slide class="slide-1"> <Label text="Heading 1" class="slide-heading h1"></Label> <Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image> </slide> <slide class="slide-2"> <Label text="Heading 2" class="slide-heading h1"></Label> <Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image> </slide> <slide class="slide-3"> <Label text="Heading 3" class="slide-heading h1"></Label> <Image src="https://placeholdit.imgix.net/~text?txtsize=19&bg=ffffff&txt=200%C3%97200&w=200&h=200"></Image> </slide> </slides> </StackLayout> <StackLayout col="0" row="1"> <Button text="Get Started" class="submit-button h2" height="80" (tap)="goToLogin()"></Button> </StackLayout> </GridLayout>

I have tried with and without the gridlayout / button at the bottom of the page. I have also tried increasing the size of the pageIndicators and removing opacity without any luck.

Thoughts?

Dynamic Create slides issues

I am creating dynamic slides using nativescript-ngx-slides plugin.
Example i have 3 person details(From Database) and i am showing only name in slides. and each slides have a person name(Label) and Add Person(Button). When add person click, i add person details in persons scope.

slides.html


<slides>
    <slide class="slide-1" *ngFor="let person of persons">
        <Label [text]="person.name"></Label>
        <Button text="Add Person" (tap)="addPerson()"></Button>
    </slide>
</slides>

slides.component.html

export class SlidesComponent implements OnInit {
    persons : Array<String> = [];
   constructor(private router: Router, private page: Page) {
    }
    @ViewChild("slides") slides: ElementRef;
    ngOnInit() {
        this.page.actionBarHidden = true;
        this.page.backgroundImage = "res://hurling";
    }
    handlePersons() {
        //Call api and get data
        this.persons = data;
    }    
   ngAfterViewInit() {
        this.handlePersons();
    }
    addPerson() {
           //Open Popup and fill details and 
           // Call Post api and save data into database
           this.persons.push(api response);
    }
}

When i added Person by Popup, after slider not working and got below error

JS: Unhandled Promise rejection: Cannot read property 'left' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'left' of undefined TypeError: Cannot read property 'left' of undefined
JS:     at SlidesComponent.positionSlides (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-ngx-slides/slides/app/slides/slides.component.js:200:18)
JS:     at SlidesComponent.setupPanel (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-ngx-slides/slides/app/slides/slides.component.js:186:14)
JS:     at file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-ngx-slides/slides/app/slides/slides.component.js:309:31
JS:     at ZoneDelegate.invoke (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:365:26)
JS:     at Zone.run (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:125:43)
JS:     at file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:760:57
JS:     at ZoneDelegate.invokeTask (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:398:31)
JS:     at Zone.runTask (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:165:47)
JS:     at drainMicroTaskQueue (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:593:35)
JS: Error: Uncaught (in promise): TypeError: Cannot read property 'left' of undefined
JS: TypeError: Cannot read property 'left' of undefined
JS:     at SlidesComponent.positionSlides (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-ngx-slides/slides/app/slides/slides.component.js:200:18)
JS:     at SlidesComponent.setupPanel (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-ngx-slides/slides/app/slides/slides.component.js:186:14)
JS:     at file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-ngx-slides/slides/app/slides/slides.component.js:309:31
JS:     at ZoneDelegate.invoke (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:365:26)
JS:     at Zone.run (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:125:43)
JS:     at file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:760:57
JS:     at ZoneDelegate.invokeTask (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:398:31)
JS:     at Zone.runTask (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:165:47)
JS:     at drainMicroTaskQueue (file:///data/data/org.nativescript.Groceries/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:593:35)

Nativescript 4 compatibility

Looks like the package.json in dist includes "tns-core-modules": "~3.4.0" and that gives the following error after upgrading the project to 4.0.0:

2018-04-14 15:24:21.559711+0200 xxx[45216:352271] JavaScript error:
2018-04-14 15:24:21.559913+0200 xxx[45216:352271] file:///app/tns_modules/nativescript-ngx-slides/node_modules/tns-core-modules/application/application.js:242:75: JS ERROR Error: A Frame must be used to navigate to a Page.

file:///app/tns_modules/nativescript-ngx-slides/node_modules/tns-core-modules/application/application.js:242:75: JS ERROR Error: A Frame must be used to navigate to a Page.

Removing the dependencies makes the project build and run again

Doesn't slide well in a TabView Item

Trying to slide to the right takes some effort because the TabView swipe is also being activated. Also, after sliding once to the right, when trying to slide back to the first slide, it stops at like 1/10 of the image width and goes back to the second slide no matter how much I try to slide.

slides are not responsive when orientation changes

with slides
changing from landscape <-> portrait mode
layout seems not responsive.

<slides>
  <slide class="slide-1">
    <Label text="This is Panel 1"></Label>
  </slide>
  <slide class="slide-2">
    <Label text="This is Panel 2"></Label>
  </slide>
  <slide class="slide-3">
    <StackLayout>
      <Label text="This is Panel 3"></Label>
      <Button class="btn btn-primary btn-active" id="button" text="Tap me!" (tap)="done()"
      clearHistory="true"></Button>
    </StackLayout>
  </slide>
</slides>

(swipe) event not working

Seems that swipe event is not working property in a XML like this:

<slides (swipe)="changeSearchItem($event)">    
        <slide *ngFor="let a of b">
            <CustomComponent customProperty="val"></CustomComponent>
         </slide>  </slides>

I've seen that we can't use callbacks when moving around the slides in this library.

tns version 4.1.0

Default width does not consider padding/margin of parent view

When computing the width of the slides it does not consider the width of the layout containing the tag <slides> , e.g., padding or margin. A workaround is to set the slide width explicitly (thanks for providing this attribute) but it would be more convenient if this could be done automatically.

Unfortunately, I haven't found a way to get the width of the parent layout yet. I hope that you just know how to deal with it :-)

The following example demonstrates the effect:

<StackLayout style="padding:40">
    <Label text="Slide 1" textWrap="true" textAlignment="center"></Label>

    <slides loop="true" pageIndicators="true">
        <slide class="slide slide-1">
            <Label text="Slide 1" textWrap="true" textAlignment="center"></Label>
        </slide>
    </slides>
</StackLayout>

Not working with AOT compilation

I have a problem with AOT compilation of this module:

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in my-app/nativescript/node_modules/nativescript-ng2-slides/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in my-app/nativescript/node_modules/nativescript-ng2-slides/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in my-app/nativescript/node_modules/nativescript-ng2-slides/node_modules/@angular/core/src/di/opaque_token.d.ts

@TheOriginalJosh, can you check it out? Any help would be appreciated. Thanks.

Slide show containing only one element result in empty slide

I am loading the data dynamically and it can happen that there is only one element in the list which I use to create the slides. In this situation the first slide is an empty one and only after calling nextSlide() the actual slide is shown.

The first slide stops in the middle of the screen on Android devices.

Hi, @TheOriginalJosh ,

Do you have any ideas why the first slide always stops in the middle of the moviment if the user quick swipe. I tryied in different projects and also in the demo project provided here, and I got the same bug everytime.

I realize that "long pressed" Pan, also "long pressed" swipe both works fine. The problem happens only with short touch interactions.

See bellow a video reproducing the issue.

Thanks in advance.

nativescript-ng2-slides - swipe bug

Apple App Store Rejected

Hello,

Thanks for the awesome component :) but the app is getting rejected by the apple app store when I am trying to upload the archive.

Here are some screenshots, any quick suggestions is appreciated.

Using XCode 8.2.1

screen shot 2017-01-06 at 11 33 34 am

Problem with building the App with nativescript-ng2-slides

Hey! I tried to build my app after installing the plugin from npm and had a merging problem.
The problem was missing semicolons ";" and some uncommented code and i had to fix those myself in the slides.component.ts
i had to comment these lines :
if (app.ios) { /*<<<<<<< HEAD*/ footerSection.clipToBounds = false; /*=======*/ footerSection.clipToBounds = false; } else if (app.android) { footerSection.android.getParent().setClipChildren(false); /*>>>>>>> origin/master*/ }
i think this is a bug, if not i would like to know why did I get the package installed like this.

Slider not full page

Hi Josh,
thx for this plugin!
Is there a possibility to have Sliders as Element in a Page?

I would like to implement 3 Elements with sliding Content in one page.

Thx and best regards
Michael

Page indicators not showing up

I'm using the plugin on android and the page indicators are not showing up.
Here is my markup

<slides #slides [pageIndicators]="true">
        <slide  class="slide-container">
         //Content
        </slide>
        <slide class="slide-container">
         //Content
        </slide>
</slides>

The related css is the following

.slides-container{
  margin-top : 20%;
  margin-bottom : 20%;
  height: 20%;
}
.slide-indicator-inactive{
  background-color: #fff;
  opacity : 0.4;
  width : 10;
  height : 10;
  margin-left : 2.5;
  margin-right : 2.5;
  margin-top : -100;
  border-radius : 5;
}

.slide-indicator-active{
  background-color: #fff;
  opacity : 0.9;
  width : 10;
  height : 10;
  margin-left : 2.5;
  margin-right : 2.5;
  margin-top : -100;
  border-radius : 5;
}

What am I missing?
I am currently using v. 0.4.3 of the plugin with nativescript angular v3.2.0

Webpack error

I got this error While using --bundle
tns build ios --bundle
capture d ecran 2018-02-13 a 18 22 40
tns info
capture d ecran 2018-02-13 a 18 24 44

Unexpected values "SlidesModule"

ERROR Error: Unexpected value 'SlidesModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

After updating an old project I removed the plugin using tns plugin remove ngx-slides and re-added it. Version changed from 0.4.1 to 1.0.0 which is generally fine.

After trying to start the app the the app crashes and showns the error message above.

In app.module.ts I have this:
import { SlidesModule } from 'nativescript-ngx-slides';
from package.json:
"nativescript-ngx-slides": "~0.4.1",
"nativescript-ngx-slides": "^1.0.0",

What have I done wrong? Seems that I'm too stupid for this world :(

Regards,
Sven

Merge conflict marker in slides.component.ts (npm)

Hi,

You have some merge conflict marker in slides.component.ts (NPM). See following error when building with your plugin :

`node_modules/nativescript-ng2-slides/slides/app/slides/slides.component.ts(127,1): error TS1185: Merge conflict marker encountered.

node_modules/nativescript-ng2-slides/slides/app/slides/slides.component.ts(129,1): error TS1185: Merge conflict marker encountered.

node_modules/nativescript-ng2-slides/slides/app/slides/slides.component.ts(133,1): error TS1185: Merge conflict marker encountered.
`

I have installed the latest releases from npm.

pageheight is incorrect

Looking at this simple example :

<slides [loop]="false" [pageIndicators]="false" pageHeight="500">
    <slide class="slide-1">
        <Label text="Slide 13" textWrap="true"></Label>
    </slide>
    <slide class="slide-2">

        <GridLayout rows="*,*,*" columns="*,*,*" backgroundColor="#00ffff">
            <Label text="Slide 2" row="0" col="2" backgroundColor="#010101"></Label>
            <Label text="Slide 2" row="1" col="2" backgroundColor="#ff0101"></Label>
            <Label text="Slide 2" row="2" col="2" backgroundColor="#01ff01"></Label>
        </GridLayout>


    </slide>
    <slide class="slide-3">
        <Label text="Slide 3" textWrap="true"></Label>
    </slide>
</slides>

we can see that at the second slide we define 3 equal heights , differnt colors.
Notice the temporary pageHeight="500" :

REsult :

image

But now let's remove pageHeight="500":

Now we see that result is - non symmetric heights :

image

all 3 colors should be the same height ( which is height/3).

Unable to swipe once tap is added to the element inside slide.

Hi,

Nice plugin btw. I'm just having a problem assigning tap event on the slider.

Here's the code:

<slides #slides>
    <slide class="slide-1">
        <Image src="Cat-hd-wallpapers.jpg" (tap)="getData()"></Image>
    </slide>
    <slide class="slide-2">
        <Image src="20130604-600.jpg"></Image>
    </slide>
</slides>

As you can see, there's (tap)="getData()" on the Image inside the slide. This will break the slider swipe. How can I prevent this? I've tried moving the (tap) attribute to the slide element but that won't trigger any tap event. Any input is appreciated. Thanks!

Tested on an Android emulator.

Android - slides

Hello, i am following your instructions for implementing this plugin. But i cant see any slides

The slides looks like the example

What am i doing wrong ?

Slide events

Hi!

Does it have events implemented? I mean events like SlideTransitionStartEvent and such. I want to add some animations to elements inside the slides and I want them to trigger when an slide starts and ends its transition.

Not working in iOS

Hi,
I have try to make a sample component using your sample code, this is working fine on android but not working on iOS.

Nativescript 4 - Not a valid plugin

When I try to install the latest version I get the following error message:

nativescript-ngx-slides is not a valid NativeScript plugin. Verify that the plugin package.json file contains a nativescript key and try again.

Please advise

Is there an option for autoplay?

Hi, I'm using this plugin in one of the projects. Is there an option for autoplay of slides, so that each slide automatically change after x seconds?

Error: Animation cancelled after host component destroy

I implement an auto running slider using setInterval()

    ngAfterViewInit(): void {
        this.interval = setInterval(()=>{
            this.topSliderComponent.nextSlide().then();
        }, 5000);

    }
    ngOnDestroy(): void {
        clearInterval(this.interval);
    }

When i route to other pages, "Animation cancelled" errors are thrown again and again.

CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:1686:28: ERROR Error: Uncaught (in promise): Error: Animation cancelled.
_rejectAnimationFinishedPromise@file:///app/tns_modules/tns-core-modules/ui/animation/animation-common.js:100:31 [<root>]
animationFinishedCallback@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:148:57 [<root>]
animationDidStopFinished@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:70:35 [<root>]
UIApplicationMain@[native code] [<root>]
start@file:///app/tns_modules/tns-core-modules/application/application.js:264:26 [<root>]
run@file:///app/tns_modules/tns-core-modules/application/application.js:284:10 [<root>]
bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:157:26 [<root>]
bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:91:38 [<root>]
bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:80:26 [<root>]
anonymous@file:///app/main.js

What shall i do to eliminate this error?

IOS- RadlistView ItemSelect event does not work inside <slide>

Hi
I am trying to embed a radlistview in one of the slides. I find that the itemSelected() event does not work on the radlistview inside of the slide. My code is as follows:

<slide>
    <GridLayout marginTop="15%" height="30%">
        <RadListView ios:minHeight="100%" #radlist [items]="options" selectionBehavior="Press" multipleSelection="true" (itemSelected)="onOptionSelected($event)" (itemDeselected)="onOptionDeselected($event)">
            <ng-template tkListItemTemplate let-item="item">
                <StackLayout class="profile-grid left-margin-10 right-margin-10" [ngClass]="{ 'box-selected': item.selected}" verticalAlignment="center">
                    <Label [text]="item.image" class='icomoon1 icon font-profile-icon' [ngClass]="{ 'box-text-selected': item.selected}"></Label>
                    <Label class="abel font-profile-text" [ngClass]="{ 'box-text-selected': item.selected}" textWrap="true" [text]="item.optionName" textAlignment="center"></Label>
                </StackLayout>
            </ng-template>
            <ListViewGridLayout tkListViewLayout scrollDirection="Vertical" ios:itemHeight="100%" spanCount="5"></ListViewGridLayout>
        </RadListView>
    </GridLayout>
    </slide>

I am using tns version 3.4.2.
Any suggestions.

Late creation of slides, e.g., after receiving the response of a HTTP request

This issue continues the discussion started at JoshDSommer/nativescript-slides#37 (comment)

@TheOriginalJosh I pulled the current version of nativescript-ng2-slides and played around with it. I have probably found a way to solve the use case 'late creation of slides'.

What I did:

  • I created a method manualInit() in SlidesComponent and moved the code from ngAfterViewInit to this new method.
  • In AppComponent I implemented ngAfterViewChecked and checked if the slides view has children. If yes, then I call manualInit().

However, this implementation is not very nice. I can imagine that SlidesComponent implements ngAfterViewChecked and checks every time it is called if the number of children has changed (= very basic way of detecting new slides). If the number has changed then SlidesComponent initialises its internal data structures.

Since I am not an expert regarding nativescript and angular, and you know your code better than me I would appreciate if you could add this behaviour to your library -- that is if it makes sense to you.

I attach the files contained in the folder slides/app of your project (except for the folder App_Resources) so you can have a look and give it a go: app.zip

Please let me know if you are unable to work on it till next Wednesday -- I need to finish my app very soon.

Thank you!

3 step form inside slides

Hi guys, I think this plugin is awesome but I´m having some troubles placing a form inside slides.

I want to make a 3 step form but the keyboard keeps overlapping on the fields.

I think some how the problem is inside de <slide> tag

Is there any workarroud or suggestions for this not to happen?

Here is the code.

<slides #formSlider pageHeight="500" [pageIndicators]="false">
                <slide slideHeight="80%">
                    <GridLayout columns="*" rows="*,50">
                        <StackLayout col="0" row="0" style="background: purple;">
                            <TextField class="field" hint="Nombre(s)"></TextField>
                            <TextField class="field" hint="Apellidos"></TextField>
                            <GridLayout rows="60" columns="*,*,*">
                                <TextField class="field" col="0" hint="Día"></TextField>
                                <TextField class="field" col="1" hint="Mes"></TextField>
                                <TextField class="field" col="2" hint="Año"></TextField>
                            </GridLayout>
                            <TextField class="field" hint="Lugar de naciemiento"></TextField>
                            <TextField class="field" hint="CURP"></TextField>
                            <TextField class="field" hint="Estado civil"></TextField>
                            <TextField class="field" hint="Religión"></TextField>
                            <TextField class="field" hint="Nombre(s)"></TextField>
                            <TextField class="field" hint="Apellidos"></TextField>
                            <GridLayout rows="60" columns="*,*,*">
                                <TextField class="field" col="0" hint="Día"></TextField>
                                <TextField class="field" col="1" hint="Mes"></TextField>
                                <TextField class="field" col="2" hint="Año"></TextField>
                            </GridLayout>
                            <TextField class="field" hint="Lugar de naciemiento"></TextField>
                            <TextField class="field" hint="CURP"></TextField>
                            <TextField class="field" hint="Estado civil"></TextField>
                            <TextField class="field" hint="Religión"></TextField>
                        </StackLayout>
                        <StackLayout col="0" row="1" style="background: yellow;">
                            <Button class="boton-primary next" text="Siguiente >" (tap)="nextStepForm()"></Button>
                        </StackLayout>    
                    </GridLayout>
                </slide>
                <slide>
                    <!-- SECOND PART OF THE FORM -->
                </slide>
                <slide>
                    <!-- THIRD PART OF THE FORM -->
                </slide>
            </slides>

Slider Autostart

Hello, great plugin first!
Is there any way the slider can start automatically?

Can't get this to work on either iOS or Android

I get the same result on both platforms. Overlapping slides that don't respond to sliding. See attached screenshot which is from the demo in /slides.

I'm guessing one of the core dependencies is an issue I just can't narrow it down. Tried all sorts of different tns-android versions, Angular versions, nativescript-angular versions etc. with no results. Using the setup in /slides doesn't work either. iOS or Android, both produce the overlapping slides.

screenshot_20171227-105856

Failed to find module

_An uncaught exception occurred on "main" thread. java,lang.RunTimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:

Error calling module function

Error calling module function

Error calling module function

Error: com.tns.NativeScriptException: Failed to find module: "./slides/app/slides.module", relative to : app/tns_modules/nativescript-ng2-slides/com.tns.Module.resolvePathHelper(Module.jasva:146)
...._

i have installed library nativescript-ng2-slides. i tryed to install library nativescript-ngx-slides but i get the same error

My package.json:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"readme": "NativeScript Application",
"repository": "",
"nativescript": {
"id": "org.nativescript.prueba2",
"tns-android": {
"version": "3.4.2"
}
},
"dependencies": {
"@angular/animations": "~5.2.0",
"@angular/common": "~5.2.0",
"@angular/compiler": "~5.2.0",
"@angular/core": "~5.2.0",
"@angular/forms": "~5.2.0",
"@angular/http": "~5.2.0",
"@angular/platform-browser": "~5.2.0",
"@angular/platform-browser-dynamic": "~5.2.0",
"@angular/router": "~5.2.0",
"nativescript-angular": "~5.2.0",
"nativescript-ng2-carousel": "0.0.5",
"nativescript-ng2-slides": "0.0.11",
"nativescript-theme-core": "~1.0.4",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.5.2",
"tns-core-modules": "^4.0.0-2018-03-02-03",
"zone.js": "~0.8.2"
},
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.6.0",
"typescript": "~2.6.2"
}
}

dynamic slides not working

hello, i am trying to use this plugin inside *ngFor
<slides pageIndicators="false" loop="false"> <slide *ngFor="let item of items; let i = index"> <GridLayout><Label [text]="i"></Label> </slide> </slides>
the plugin crashes and i am unable to slide between the slides

Docklayout in slide element is not using the correct height

<slides #slides [loop]="false" [pageIndicators]="false" *ngIf="data.length > 0" (changed)="slideChanged($event)">

    <slide height="100%">
        <DockLayout stretchLastChild="true">
            <Button dock="top" text="top" style="background-color: lightblue; margin: 5;"></Button>
            <Button dock="bottom" text="bottom" style="background-color: lightpink; margin: 5;"></Button>
            <Button text="fill" style="background-color: wheat; margin: 5;"></Button>
        </DockLayout>
    </slide>

As you can see on the screenshot the height of the complete slide is only about 33% of the whole screen.

screenshot_1520725799

I've tried several things, adding height=100% to various elements, also that pageHeight="500" from another issue I found here. But I didn't get this to work.

Any ideas?

Appreciate any help!

Thanks in advance!

Unexpected CFBundleExecutable Key: Processing in itunesconnect failed

After uploading the app using the plugin I got the following message:

Unexpected CFBundleExecutable Key - The bundle at '/Payload/stilpbapp.app/app/tns_modules/nativescript-ngx-slides/slides/app/App_Resources/iOS/Info.plist' does not contain a bundle executable. If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue.

After changing the plugin as suggested in the message my app ran through. Would these changes do any harm if persisted in the repository?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.