2016-09-23 6 views
0

ないコードのこの行には、私は眠ることないんなぜ角工場スローTypeError例外:__tracer.traceFunCall(...)が機能

それをロード
$scope.search = function (login) { 
     github.getUser(login).then(onUserResponse, onError); 
    }; 

angular.module('lol') 
    .factory('github', github); 

:このsigantureで

return { 
     getUser: getUser, 
     getRepos: getRepos 
    }; 

:二つの機能を返します

var MainCtrl = function ($scope, github, $filter, $timeout, $intervel, $anchorScroll, $location) { 

そしてません、それは依存関係だに注入:アプリは、次のようにロードされた状態で

MainCtrl.$inject = ['$scope', '$filter', '$interval', '$timeout', '$anchorScroll', '$location']; 

angular.module('lol', []) 
    .controller('MainCtrl', MainCtrl); 

そして、このスローのすべてのメインコントローラによって消費

var github = function ($http) { 

TypeError: __tracer.traceFunCall(...) is not a function

+0

[jsbin](http://jsbin.com/mifukibugu/edit?html,js,console,output) –

答えて

0

でも、githubが2番目のパラメータとして間違っていたと思います。here コード組織が必要以上の状況を複雑にしていました。その様子からも は、あなたはそれが次にhere.

+0

をすべきか二つのモジュール簡単な例を実行しようとしましたエラー:[$ injector:unpr]不明なプロバイダ:v0Provider < - v0 < - github' –

+0

jsbinまたはplunkerと共有リンクにコードm8を貼り付けてください。エラーの角度の外見から 'github'工場を見つけることができません。 – Augustas

+0

https://jsbin.com/mifukibugu/edit?html,js,console,output –

関連する問題