在我的Angular JS应用程序中,我想知道哪些服务,模块在控制器中使用?

时间:2016-08-31 02:38:22

标签: javascript angularjs controllers angular-filters

在我的Angular JS应用程序中,我有30个控制器,120个服务,60个指令,20个过滤器,10个模块。如何在呼叫 - 被叫/注入服务/工厂关系中引入所有这四者之间的关系?

例如: ControllerA注入了Service1,Service2等。 Service1使用Service7,Service8等。 Service2使用Filter1,Filter7等

我需要通过将这四个矩阵保存在矩阵中来构建矩阵。

随着代码的发展,这有助于我在很高的层次上理解代码。

2 个答案:

答案 0 :(得分:1)

我想是的 - 我们可以从我们的应用程序获得注册服务。 在angular中,<div class="head-title text-center hide"> <h3 class="form-title"><span class="underline">Quote Total:</span> <span class="orange quote-total">0</span></h3> <p>excludes <span class="orange">GST</span></p> <p>Would you like us to contact you about this quote?</p> <div style="display:none">[text total-quote id:total-quote class:total-quote]</div> </div> <div class="your-info line clearfix hide"> <div class="line contactme clearfix">[text* email-phone id:email-phone class:email-phone placeholder "Email or Phone No"][text your-name id:your-name class:your-name placeholder "Your Name"][text post-code id:post-code class:post-code placeholder "Post Code"][submit id:contact-me class:btn-contact-me "Contact Me"]</div> <div class="line quote clearfix">[email* your-email id:your-email class:your-email placeholder "Email Address"][text your-name1 id:your-name1 class:your-name1 placeholder "Your Name"][text post-code1 id:post-code1 class:post-code1 placeholder "Post Code"][submit id:email-quote class:btn-email-quote "Email Quote"]</div> </div> <div class="line clearfix"><h2 class="underline orange">Step 1</h2>How wide is your driveway?: [number* driveway-meters min:0 id:driveway-meters class:driveway-meters class:change-quote "10"] meters</div> <div class="line clearfix"><h2 class="underline orange">Step 2</h2>How far is your garage from the footpath?: [number* footpath-meters min:0 id:footpath-meters class:footpath-meters class:change-quote "20"] meters</div> <div class="line clearfix"><h2 class="underline orange">Step 3</h2>Choose your concrete finish: [select* finish id:finish class:finish class:change-quote "$65 sq/m|Plain" "$80 sq/m|Coloured Concrete" "$120 sq/m|Exposed Aggregate" "$120 sq/m|Stenciled"] <span class="icon-info"></span></div> <div class="line text-center clearfix">[submit id:caculate-quote class:btn-caculate-quote "Caculate Quote"]</div>包含module数组,其中包含应用程序中所有服务的列表。因此,您可以遍历_invokeQueue

_invokeQueue

答案 1 :(得分:1)

我建议不要从头开始,看看其中一个npm模块。它们以图形格式生成报告。您可以将其添加为CI构建步骤的一部分,以生成体系结构图作为每个构建的工件。

https://github.com/lucalanca/grunt-angular-architecture-graph

https://github.com/vogloblinsky/gulp-angular-architecture-graph

这些npm包要求您在CI代理中安装GraphZViz。

还有一些Google Chrome扩展程序,如AngularJS Batarag和AngularJS Graph,可以帮助您查看依赖项。