{"action":"created","issue":{"url":"https://api.github.com/repos/jonashagstedt/swampdragon/issues/109","labels_url":"https://api.github.com/repos/jonashagstedt/swampdragon/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/jonashagstedt/swampdragon/issues/109/comments","events_url":"https://api.github.com/repos/jonashagstedt/swampdragon/issues/109/events","html_url":"https://github.com/jonashagstedt/swampdragon/issues/109","id":90475510,"number":109,"title":"Cant't create.","user":{"login":"xxxkilldogxxx","id":1025672,"avatar_url":"https://avatars.githubusercontent.com/u/1025672?v=3","gravatar_id":"","url":"https://api.github.com/users/xxxkilldogxxx","html_url":"https://github.com/xxxkilldogxxx","followers_url":"https://api.github.com/users/xxxkilldogxxx/followers","following_url":"https://api.github.com/users/xxxkilldogxxx/following{/other_user}","gists_url":"https://api.github.com/users/xxxkilldogxxx/gists{/gist_id}","starred_url":"https://api.github.com/users/xxxkilldogxxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxxkilldogxxx/subscriptions","organizations_url":"https://api.github.com/users/xxxkilldogxxx/orgs","repos_url":"https://api.github.com/users/xxxkilldogxxx/repos","events_url":"https://api.github.com/users/xxxkilldogxxx/events{/privacy}","received_events_url":"https://api.github.com/users/xxxkilldogxxx/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jonashagstedt/swampdragon/labels/Support","name":"Support","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-23T19:48:48Z","updated_at":"2015-06-23T21:10:16Z","closed_at":null,"body":" When using my sendMessage() function i keep getting this error:\r\n\r\n    $scope.sendMessage = function(message) {\r\n        console.log(\"GETTING SEND MESSAGE FUNCTION\");\r\n        $dragon.create('message-route', {message:'test'}).then(function(response) {\r\n            console.log(response);\r\n        }).catch(function(errors) {\r\n            console.log(errors)\r\n        });\r\n    }\r\n\r\nThis is the error I keep getting... I'm very new to angularJS so not really sure what I'm doing wrong.\r\n\r\nTypeError: Cannot read property 'send' of null\r\n    at Object.5.s.send (swampdragon.min.js:1)\r\n    at Object.5.s.sendJSON (swampdragon.min.js:1)\r\n    at Object.5.s.callRouter (swampdragon.min.js:1)\r\n    at Object.callRouter (services.js:9)\r\n    at Object.create (services.js:41)\r\n    at k.$scope.sendMessage (controllers.js:28)\r\n    at cb.functionCall (angular.js:10795)\r\n    at angular.js:19036\r\n    at k.$get.k.$eval (angular.js:12632)\r\n    at k.$get.k.$apply (angular.js:12730)\r\n\r\nAny help would be awesome, I love this framework and I am going to be using it on my latest project."},"comment":{"url":"https://api.github.com/repos/jonashagstedt/swampdragon/issues/comments/114642632","html_url":"https://github.com/jonashagstedt/swampdragon/issues/109#issuecomment-114642632","issue_url":"https://api.github.com/repos/jonashagstedt/swampdragon/issues/109","id":114642632,"user":{"login":"xxxkilldogxxx","id":1025672,"avatar_url":"https://avatars.githubusercontent.com/u/1025672?v=3","gravatar_id":"","url":"https://api.github.com/users/xxxkilldogxxx","html_url":"https://github.com/xxxkilldogxxx","followers_url":"https://api.github.com/users/xxxkilldogxxx/followers","following_url":"https://api.github.com/users/xxxkilldogxxx/following{/other_user}","gists_url":"https://api.github.com/users/xxxkilldogxxx/gists{/gist_id}","starred_url":"https://api.github.com/users/xxxkilldogxxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxxkilldogxxx/subscriptions","organizations_url":"https://api.github.com/users/xxxkilldogxxx/orgs","repos_url":"https://api.github.com/users/xxxkilldogxxx/repos","events_url":"https://api.github.com/users/xxxkilldogxxx/events{/privacy}","received_events_url":"https://api.github.com/users/xxxkilldogxxx/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T21:10:16Z","updated_at":"2015-06-23T21:10:16Z","body":"here is my router:\r\n\r\n    from swampdragon import route_handler\r\n    from swampdragon.route_handler import ModelRouter\r\n    from chat.models import Messages\r\n    from chat.serializers import MessageSerializer, UserSerializer\r\n    from django.contrib.auth.decorators import login_required\r\n    from accounts.models import User\r\n    import logging\r\n\r\n    log = logging.getLogger(__name__)\r\n\r\n    class MessageRouter(ModelRouter):\r\n\r\n        route_name = 'message-route'\r\n        serializer_class = MessageSerializer\r\n        model = Messages\r\n        include_related = [UserSerializer,]\r\n\r\n        def get_initial(self, verb, **kwargs):\r\n            log.warning(\"GETTING INITIAL\")\r\n            user = User.objects.get(pk=kwargs['user_id'])\r\n            print(str(user.nickname))\r\n            return {'user': user}\r\n\r\n        def get_object(self, **kwargs):\r\n            return self.model.objects.get(pk=kwargs['id'])\r\n\r\n        def get_query_set(self, **kwargs):\r\n            return self.model.objects.all()\r\n\r\n    route_handler.register(MessageRouter)\r\n\r\n"}}