Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in delivering result of invoking 'search.source': TypeError: Cannot read property 'data' of undefined #36

Open
mattiLeBlanc opened this issue Sep 4, 2015 · 1 comment

Comments

@mattiLeBlanc
Copy link

Hi,

I am trying to use Searchsource in my Meteor Angular project.
The implementation as I used to do it in my meteor only project with Blaze seems to work, however on page load I get this error message:
Exception in delivering result of invoking 'search.source': TypeError: Cannot read property 'data' of undefined

My code:

angular.module( 'myapp' ).controller 'feedListCtrl',
  ($scope, $meteor, $state , $stateParams ) ->

    feedName = $stateParams.term
    limit = 30
    sort =
      'publishedDate': -1

    $scope.channelData = null
    $scope.episodes = null
    $scope.channelLoading = true
    $scope.episodeCount = 0
    $scope.activeListItem = null

    $scope.channel  = $meteor.subscribe( 'channelMetaByName', feedName )
    $scope.feed     = $meteor.subscribe( 'feedsByChannelName', feedName, sort )



    # $scope.feed     = $meteor.collection( Feeds, false ).subscribe( 'feedsByChannelName', feedName, sort )
    # $scope.channel  = $meteor.collection( Channels, false ).subscribe( 'channelMetaByName', feedName )

    $scope.channel.then ( subscription )->
      $scope.channelLoading   = false
      $scope.channelData      = Channels.findOne().channelMeta


    $scope.feed.then ( subscription ) ->
      $scope.episodes = Feeds.find().fetch()
      $scope.episodeCount = Feeds.find().count()

    $meteor.autorun $scope, ->
      console.log("search", $scope.getReactively( 'search' ) )
      FeedSearch.search $scope.getReactively( 'search' )

Besides the error message, the search does work in the autorun part. When I call getData I do get the filtered results.
Any idea what is going wrong?

@valorloff
Copy link

+1
i have same error in meteor-blaze

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

No branches or pull requests

2 participants