GithubHelp home page GithubHelp logo

angularjs-carousel's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

angularjs-carousel's Issues

$transclude undefined on carousel initialization.

I'm getting an error deep in the Angular library when trying to use the carousel in my project.

TypeError: undefined is not a function
    at new ngDirective.controller (http://localhost/lib/angular/angular.js:13962:5)
    at invoke (http://localhost/lib/angular/angular.js:2864:28)
    at Object.instantiate (http://localhost/lib/angular/angular.js:2874:23)
    at http://localhost/lib/angular/angular.js:4759:24
    at http://localhost/lib/angular/angular.js:4338:17
    at forEach (http://localhost/lib/angular/angular.js:138:20)
    at nodeLinkFn (http://localhost/lib/angular/angular.js:4323:11)
    at compositeLinkFn (http://localhost/lib/angular/angular.js:3969:15)
    at publicLinkFn (http://localhost/lib/angular/angular.js:3874:30)
    at http://localhost/lib/carousel.js:317:13 <div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel ng-isolate-scope ng-scope" data-carousel="" data-on-page-upcoming="loadPage(page, tmplCb)" data-give-carousel-to="onCarouselAvailable(carousel)"> 

Some background: our application is structured a bit differently than the sample. It uses routes, which specify controllers and the controllers are in a separate file. To start out, I borrowed the FlickrApi factory, CSS classes and controller functions, just to minimize the differences. So the overall effect should have been simply running the sample in the context of one of my partials, the underlying controller of which was modified to contain the same functions used by the example.

The problem seems related to initializing the carousel. Sometime after the function specified by the data-on-page-upcoming attribute runs, Angular is invoked and the exception shown above appears in the Javascript console.

What's failing is this Angular code. Specifically, $transclude is undefined.

var ngTranscludeDirective = ngDirective({
  controller: ['$transclude', '$element', function($transclude, $element) {
    $transclude(function(clone) {
      $element.append(clone);
    });
  }]
});

Does something need to be done to define $transclude? I've Googled around but haven't found a good answer. I did try setting "transclude" to true in the carousel directive. This didn't help and, truth be told, I don't know what it actually does.

Final note, I'm using a slightly newer Angular: 1.0.6. I tried to use the version used in the example (1.0.4)and it failed with the same error.

break styles/animations out

Would be nice if any style rules were separated into a stylesheet, or otherwise optional.
Using ng-animate to handle the animations would be awesome.

Multiple directives asking for new/isolated scope

Since I installed angularjs version 1.2.1, an error raises when Angular processes the Carousel directive.

Error: [$compile:multidir] Multiple directives [carousel, carousel] asking for new/isolated scope.

Looks like the name "carousel" for the directive is conflictive with another variable. I've changed the name of the directive by myCarousel (HTML: data-my-carousel) and that solved the error.

Best!

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.