View source Improve this doc

# `ngSubmit`
directive in module `ng`

## Description

Enables binding angular expressions to onsubmit events.

Additionally it prevents the default action (which for form means sending the request to the server and reloading the current page) but only if the form does not contain an `action` attribute.

## Usage

as attribute

    <form ng-submit="{expression}">
       ...
    </form>

as class

    <form class="ng-submit: {expression};">
       ...
    </form>

#### Parameters

Param | Type | Details
--- | --- | ---
ngSubmit | expression | Expression to eval. (Event object is available as `$event`)

## Example

#### Source

## Demo