Skip to content

Are you sure the factory works correctly? #12

@moltar

Description

@moltar
class ThingFactory {

    /*@ngInject*/
    constructor($timeout) {
        this.$timeout = $timeout;
    }

    newThing() {
        console.log('Getting a new Thing...');
        return this.$timeout(() => new Thing(), 100);
    }
}

register('app').factory('thingFactory', ThingFactory);

In my app, newThing() doesn't have access to ThingFactory object's this. Rather this points to window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions