Ashane Alvis
Ashane Alvis

Reputation: 810

Unknown AngualrJS error (i'm a bigginer)

OK, I don't know how to ask this question, so i'm gonna explain this. I have a fade in model that reads my terms and conditions in the same page as the model. I have given the URL for the model as t_and_c_m (<a href="/t_and_c_m">). The fade in works perfectly. But gives me an error that it cannot find the URL. True, because I haven't a separate html file for Terms & conditions. How to fix this error using angularjs.

Here the html code: signup.html

<div class="row">
                    <div class="col-xs-4 col-sm-3 col-md-3">
                        <span class="button-checkbox">
                            <button type="button" class="btn" data-color="info" tabindex="7">I Agree</button>
                            <input type="checkbox" name="t_and_c" id="t_and_c" class="hidden" value="1">
                        </span>
                    </div>
                    <div class="col-xs-8 col-sm-9 col-md-9">
                        By clicking <strong class="label label-primary">Register</strong>, you agree to the <a href="/t_and_c_m" data-toggle="modal" data-target="#t_and_c_m">Terms and Conditions</a> set out by this site, including our Cookie Use.
                    </div>
                </div>

                <hr class="colorgraph" />
                <div class="row">
                    <div class="col-xs-12 col-md-6"><input type="submit" value="Register" class="btn btn-primary btn-block btn-lg" tabindex="7"></div>
                </div>

Next comes my terms & conditions Model in the same page (signup.html)

<div class="modal fade" id="t_and_c_m" tabindex="-1" role="dialog" aria-labelledby="myModelLabel" aria-hidden="true">
        <div class="modal-dialog model-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
                    <h4 class="modal-title" id="myModalLabel">Terms & Conditions</h4>
                </div>
                <div class="modal-body">
                    <p>Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions</p>
                    <p>Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions</p>
                    <p>Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions</p>
                    <p>Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions</p>
                    <p>Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions</p>
                    <p>Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions, Terms & conditions</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal">I Agree</button>
                </div>
            </div>
        </div>
    </div>

And finally my app: app.js

$routeProvider
    .when('/t_and_c_m',
    {
        activatetab: '#t_and_c_m'
    });

The error is that it cannot find the t_and_c_m URL. Even when I delete the code app, still shows the error. Need help.

The reference example: http://bootsnipp.com/snippets/featured/mix-amp-match-register

Upvotes: 1

Views: 56

Answers (1)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85583

Do not use underscore in the url.

why should I not use underscore

So, I think removing underscore and using dash will not cause you the error.

Upvotes: 2

Related Questions