How to use PNotify within angular

1

I have the following code and I want to use PNotify to give notifications when the user and / or password is incorrect or / and mandatory field is blank. How do I do? Remembering that I'm using ASP.NET MVC and have already referenced the PNotify JavaScript and CSS file in my Layout.cshtml

<div>
    <a class="hiddenanchor" id="signup"></a>
    <a class="hiddenanchor" id="signin"></a>

    <div class="login_wrapper">
        <div class="animate form login_form" ng-controller="LoginCtrl">
            <section class="login_content">
                <form>
                    <h1>Login Form</h1>
                    <div>
                        <input type="text" class="form-control" placeholder="Username" required="" ng-model="model.username" />
                    </div>
                    <div>
                        <input type="password" class="form-control" placeholder="Password" required="" ng-model="model.password"/>
                    </div>




                    <div>
                        <a class="btn btn-default submit" ng-click="doLogin(model)">Log in</a>
                        <a class="reset_pass" href="#">Lost your password?</a>
                    </div>

                    <div class="clearfix"></div>

                    <div class="separator">
                        <p class="change_link">
                            New to site?
                            <a href="#signup" class="to_register"> Create Account </a>
                        </p>

                        <div class="clearfix"></div>
                        <br />

                        <div>
                            <h1><i class="fa fa-paw"></i> Gentelella Alela!</h1>
                            <p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 3 template. Privacy and Terms</p>
                        </div>
                    </div>
                </form>
            </section>
        </div>

        <div id="register" class="animate form registration_form">
            <section class="login_content">
                <form>
                    <h1>Create Account</h1>
                    <div>
                        <input type="text" class="form-control" placeholder="Username" required="" />
                    </div>
                    <div>
                        <input type="email" class="form-control" placeholder="Email" required="" />
                    </div>
                    <div>
                        <input type="password" class="form-control" placeholder="Password" required="" />
                    </div>
                    <div>
                        <a class="btn btn-default submit" href="index.html">Submit</a>
                    </div>

                    <div class="clearfix"></div>

                    <div class="separator">
                        <p class="change_link">
                            Already a member ?
                            <a href="#signin" class="to_register"> Log in </a>
                        </p>

                        <div class="clearfix"></div>
                        <br />

                        <div>
                            <h1><i class="fa fa-paw"></i> Gentelella Alela!</h1>
                            <p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 3 template. Privacy and Terms</p>
                        </div>
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
    
asked by anonymous 16.03.2017 / 19:44

1 answer

1

Just put the references in PNotify within your ng-app that is in the file Layout.cshtml

<body class="nav-md" ng-app="AutonavAPP">
@RenderBody()

<!--PNotify-->
<script src="~/vendors/pnotify/dist/pnotify.js" type="text/javascript"></script>
<link href="~/vendors/pnotify/dist/pnotify.css" media="all" rel="stylesheet" type="text/css" />
    
16.03.2017 / 20:03