View source Improve this doc

ngInit
directive in module ng

Description

The ngInit directive specifies initialization tasks to be executed before the template enters execution mode during bootstrap.

Usage

as attribute
<ANY ng-init="{expression}">
   ...
</ANY>
as class
<ANY class="ng-init: {expression};">
   ...
</ANY>

Parameters

ParamTypeDetails
ngInitexpression

Expression to eval.

Example

Source





Demo