Skip to content

The Change Log do no list all Breaking changes (Alpha 24: No provider for ... )ย #2058

Closed
@jomeier

Description

This code:

/// <reference path="../../Scripts/typings/angular2/angular2.d.ts" />    // <- Interfacedefinitionen fรผr Angular2
import {Component, View, bootstrap} from 'angular2/angular2';
import {Inject, Injectable} from 'angular2/di';

class test1 {
    geta() { return "balupp"; }
}

@Component({
    selector: 'app',
    properties: { 'newtodo': 'newtodo' },
    injectables: [test1]  // Dependency Injection von 'test1' 
})
@View({
    templateUrl: 'partials/meineseite'
})
class MyAppComponent {
    constructor(webs:test1) {  
...

gives me this error message with Angular alpha 24 ๐Ÿ‘

No provider for test1! (MyAppComponent -> test1)                      angular2.dev.js:18126

Error
    at NoBindingError.BaseException (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:7163:25)
    at NoBindingError.AbstractBindingError (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:10465:66)
    at new NoBindingError (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:10483:60)
    at Injector.execute.Injector._getByKey (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:23168:21)
    at Injector.execute.Injector._getByKey (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:23163:35)
    at Injector.execute.Injector.get (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:23131:25)
    at ElementInjector.execute.ElementInjector._getByKey (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:25202:51)
    at ElementInjector.execute.ElementInjector._getByDependency (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:24983:25)
    at ElementInjector.execute.ElementInjector._new (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:24903:71)
    at ElementInjector.execute.ElementInjector._getObjByKeyId (https://code.angularjs.org/2.0.0-alpha.24/angular2.dev.js:25222:35)execute.BrowserDomAdapter.logError @ angular2.dev.js:18126defaultErrorReporter @ angular2.dev.js:26096execute.NgZone._onError @ angular2.dev.js:13015execute.NgZone._createInnerZone.errorHandling.onError @ angular2.dev.js:12963run @ angular2.dev.js:118execute.NgZone._createInnerZone.zone.fork.fork.$run @ angular2.dev.js:12977zoneBoundFn @ angular2.dev.js:88lib$es6$promise$$internal$$tryCatch @ angular2.dev.js:479lib$es6$promise$$internal$$invokeCallback @ angular2.dev.js:491lib$es6$promise$$internal$$publish @ angular2.dev.js:462(anonymous function) @ angular2.dev.js:195execute.NgZone._createInnerZone.zone.fork.fork.$scheduleMicrotask.microtask @ angular2.dev.js:12997run @ angular2.dev.js:115execute.NgZone._createInnerZone.zone.fork.fork.$run @ angular2.dev.js:12977zoneBoundFn @ angular2.dev.js:88flush @ angular2.dev.js:1208

It workes with Angular alpha 23.

Setup: Typescript 1.5beta, --emitDecoratorMetadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions