How to check for the existence of a module without an error being raised?

前端 未结 7 760
小蘑菇
小蘑菇 2020-12-24 01:04

In Angular 1.2, ngRoute is a separate module so you can use other community routers like ui.router instead.

I\'m writing an open-source mod

7条回答
  •  囚心锁ツ
    2020-12-24 02:02

    AngularJS 1.6.3 and up has a way to check if a module is loaded via the $injector service.

    Also added in 1.6.7 was the ability to load new modules which may be of interest to some.

提交回复
热议问题