AngularJs Directives Loaded Event

HockeyJ

I have just started using AngularJs directives, using the resources here, here and here.

I have a situation where i need to do something after all directives have been loaded.

i.e

Scenario 1

  • Controller Loads
  • Directive 1 loads
  • Directive 2 loads
  • Final event fires (preferably picked up by the controller)

Scenario 2

  • Controller loads
  • Directive 1 loads
  • Directive 2 loads
  • Directive 3 loads
  • Final event fires (preferably picked up by the controller)

I can't seem to find a 'directives loaded' event. With a search, the best I could find was this SO post, (for which this answer does work), but it feels like a 'broad brush' approach.

What is the correct way of doing this please?

Happy to post code if needed, but it doesn't seem beneficial in this instance.

HockeyJ

For the benefit of searchers...

@jack.the.ripper 's comment was correct. The SignalR stuff did need moving out to a service.

In the case of notifying when all directives were loaded, this has been working nicely.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Unit testing angularjs directives's event broadcast

From Dev

Is there any way to prioritize the order of controllers/directives being loaded in page in AngularJS?

From Dev

How to inject AngularJS custom directives into a bootstrap pre-loaded modal?

From Dev

AngularJS directives to hide zero when <input> is initially loaded to the DOM

From Java

Image loaded event in for ng-src in AngularJS

From Dev

AngularJS testing directives with Karma, Jasmine and ngHtml2JsPreprocessor: template not loaded

From Dev

Angularjs - does ng-switch have a content loaded event?

From Dev

Parsing dynamically loaded directives in Vue

From Dev

AngularJS Controller as syntax and Directives

From Dev

AngularJS 'agnostic' and 'component' directives

From Dev

AngularJs directives issue

From Dev

Applying validation in angularjs directives

From Dev

AngularJS - Directives vs Controllers

From Dev

AngularJS and nesting Directives

From Dev

Nesting angularjs directives recursively

From Dev

troubleshooting AngularJS directives

From Dev

AngularJS Directives and the Model

From Dev

AngularJS : directives and scope

From Dev

AngularJS - Directives in a template

From Dev

AngularJS: "Controller as" syntax and directives

From Dev

AngularJs scope reference with directives

From Dev

Angularjs: Directives load order

From Dev

AngularJS communication between directives

From Dev

AngularJS - Wrapping directives

From Dev

AngularJS ngrepeat and directives

From Dev

AngularJS Nested Directives

From Dev

Custom directives and routing in AngularJS

From Dev

AngularJS Directives and the link function

From Dev

AngularJS: Communication between directives

Related Related

HotTag

Archive