Code Monkey home page Code Monkey logo

Comments (2)

wishtreedotpro avatar wishtreedotpro commented on August 10, 2024 1

Hi,
You just need to use one of the built in option in this directive, it`s written here in github:

For initialization carousel after data is loaded use init-onload property. Example:

> <slick init-onload=true data="awesomeThings">
>   ...
> </slick>

so, just write the correct name of your scope in data attribute.

from angular-slick.

dashcraft avatar dashcraft commented on August 10, 2024

From a recent experience, you have to call the slick directive and nested div's in a specific manner.
This slick directive from my experience, doesn't like being the container for your images.
I usually container my directives regardless, but this is how i accomplished something similar.

This scrolls through about 30 images around 1mb apiece, without issue.

Here is an example HTML file for a synced nav using the slick directive.
`











`

Here is a controller config, but i am extracting it into a service soon.

.controller("ImageCtrl", function image_controller(
$scope,
$timeout,
$stateParams,
$filter,
$http,
$q,
$log) {
console.log("Image Controller loaded");
console.log($stateParams.category);
getImages();
$scope.filter = $stateParams.category;

        function getPromiseImages() {
            var deferred = $q.defer();
            $http.get('/api/images').then(
                function handleSuccess(response) {
                  console.log("Got promise list of images.");
                    deferred.resolve(response.data);
                },
                function handleError(response) {
                    console.log("Promise list of images failed.");
                });
            return deferred.promise;
        }
        function getImages(){
            getPromiseImages().then(function(data){
                $scope.$applyAsync(function(){
                    console.log(JSON.stringify(data));
                    $scope.images = data;   
                }); 
            });
        }

    });`

from angular-slick.

Related Issues (20)

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.