Angularjs 已编译指令中未定义注入工厂

Angularjs 已编译指令中未定义注入工厂,angularjs,angularjs-directive,Angularjs,Angularjs Directive,我的编译指令有一个问题,注入工厂返回未定义。我已经检查了拼写,所有的都检查出来了 我通过使用在单击时动态插入指令 var elDetails = $compile('<profiles></profiles>')($scope); 我还有一个名为Profiles的工厂,它如下所示: app.factory('Profiles', function($http) { var Profiles = function() { this.items =

我的编译指令有一个问题,注入工厂返回未定义。我已经检查了拼写,所有的都检查出来了

我通过使用在单击时动态插入指令

var elDetails = $compile('<profiles></profiles>')($scope);
我还有一个名为Profiles的工厂,它如下所示:

app.factory('Profiles', function($http) {
    var Profiles = function() {
        this.items = [];
        this.busy = false;
        this.after = 0;
        this.orderBy = 'CreatedDate,CompletedDate';
        this.filter = '';
    };
我做错了什么?谢谢


约翰。

那太愚蠢了。我忘了还我的工厂

app.factory('Profiles', function($http) {
    var Profiles = function() {
        this.items = [];
        this.busy = false;
        this.after = 0;
        this.orderBy = 'CreatedDate,CompletedDate';
        this.filter = '';
    };

    return Profiles;
});
app.factory('Profiles', function($http) {
    var Profiles = function() {
        this.items = [];
        this.busy = false;
        this.after = 0;
        this.orderBy = 'CreatedDate,CompletedDate';
        this.filter = '';
    };

    return Profiles;
});