1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Angular.js アプリのコンポーネントを Developer Tools で取得

1
Last updated at Posted at 2014-05-27

Angular.js アプリをいじっていて、特に私のような初心者だとコンポーネントが実際にどんなもんなのか、JavaScript コンソールでごにょごにょしながら理解したいなーというときがある。

var myApp = angular.module("myApp", []);
myApp.service('BlogService', function() {
  // do something
});

上記のような module、service がある場合には以下のような感じで。

angular.injector(["ng", "myApp"]).get("BlogService")

API ドキュメントは以下。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?