I'm making a site with Craft CMS/Angularjs. I'm using angular to filter and display entries on the index page and it's working good so far except for one thing. The login/register/entry form's all don't function at all. If I remove ng-app from the html tag they work just fine so it's definitely angular that's causing this issue.

Here's my login form on the main page:

{% if currentUser %}
        You are logged in as <strong>{{ currentUser.friendlyName }}</strong>
        <a href="/logout">logout</a>

    {% else %}

    <form method="post" action="" accept-charset="UTF-8">
        <input type="hidden" name="action" value="users/login">

        <h3><label for="loginName">Username</label></h3>
        <input id="loginName" type="text" name="loginName">

        <h3><label for="password">Password</label></h3>
        <input id="password" type="password" name="password">

        <input type="submit" value="Login">

        {% if errorMessage is defined %}
            <p>{{ errorMessage }}</p>
        {% endif %}
        <p>Please login or <a href="/register">register</a></p>

    {% endif %}

If anyone with experience using angular and craft together can chime in that'll be great.

1 Answer 1


Okay so I figured it out. Turns out a form won't submit in an Angular app if it doesn't have an action specified.

  • 1
    By omitting the action attribute, all a form does is submit itself to the same url it resides on. As a workaround, you can use craft.request.url as the action. Oct 8, 2014 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.