Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

transcludeFn is not defined #42

Closed
jeremydstanton opened this issue Dec 11, 2013 · 3 comments
Closed

transcludeFn is not defined #42

jeremydstanton opened this issue Dec 11, 2013 · 3 comments

Comments

@jeremydstanton
Copy link

I am using angular 1.2.0 with the latest ng-tags-input build. I thought I cut and pasted the examples directly into my code but I am getting this error when I refresh the page:

TypeError: undefined is not a function
at http://localhost:8080/app/vendor/ng-tags-input/ng-tags-input.js:464:9

...which means that in this function...

  tagsInput.directive('transcludeAppend', function() {
      return function(scope, element, attrs, ctrl, transcludeFn) {
          transcludeFn(function(clone) {
              element.append(clone);
          });
      };
  });

...transcludeFn is not defined. My template contains this...

  <tags-input ng-model="tags" placeholder="Add a tag">
    <auto-complete source="loadTags($query)"></auto-complete>
  </tags-input>

...and my controller contains this...

$scope.loadTags = function(query) {
  return $http.get('/tags?query=' + query).then(function(response) {
    return response.data;
  });
};

...please help?

@mbenford
Copy link
Owner

Hi Jeremy.

The culprit is Angular 1.2.0 (and me, of course, for not having updated the docs properly). There was a bug in that version related to transclusion and the fix involved passing the transcludeFn in the link function (before it was passed in the compile function).

So, you have to upgrade to version 1.2.1 in order to use ngTagsInput. I am truly sorry for having stated in the docs that Angular 1.2+ was supported. I'll fix that right now.

@jeremydstanton
Copy link
Author

Ah, so it's 1.2.1 rather than 1.2.0. Excellent!

On Tue, Dec 10, 2013 at 10:05 PM, Michael Benford
[email protected]:

Hi Jeremy.

The culprit is Angular 1.2.0 (and me, of course, for not having updated
the docs properly). There was a bughttps://github.com/angular/angular.js/issues/4935in that version related to transclusion and the
fixhttps://github.com/angular/angular.js/commit/90f87072e83234ae366cfeb3c281503c31dad738involved passing the transcludeFn in the
link function (before it was passed in the compile function).

So, you have to upgrade to version 1.2.1 in order to use ngTagsInput. I am
truly sorry for having stated in the docs that Angular 1.2+ was supported.
I'll fix that right now.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-30290297
.

@artem-galas
Copy link

very thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants