mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-26 22:35:15 +08:00
fix(injector) .instantiate([Type]) produced wrong result
This commit is contained in:
@@ -605,6 +605,15 @@ describe('injector', function() {
|
||||
});
|
||||
|
||||
|
||||
it('should instantiate object and preserve constructor property and be instanceof', function() {
|
||||
var t = $injector.instantiate(['book', 'author', Type]);
|
||||
expect(t.book).toEqual('moby');
|
||||
expect(t.author).toEqual('melville');
|
||||
expect(t.title()).toEqual('melville: moby');
|
||||
expect(t instanceof Type).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
it('should allow constructor to return different object', function() {
|
||||
var obj = {};
|
||||
var Class = function() {
|
||||
|
||||
Reference in New Issue
Block a user