AngularJS视图中没有控制器或VM?

时间:2017-08-28 17:49:47

标签: angularjs

这是如何工作的? AngularJS是否需要提及脚本才能使用它?

我一直使用"控制器作为" AngularJS中的语法。但是,我刚刚购买了一个模板,并且HTML中没有控制器。没有LoginCtrl as vm或任何其他提及任何后端脚本。

$stateProvider.state('realLogin', {
    url: '/real-login',

    views: {
        root: {
            templateUrl: "app/auth/login/login.html",
            controller: 'LoginCtrl'
        }
    },
    data: {
        title: 'Login',
        rootId: 'extra-page'
    }

})

HTML就是......

<div class="container">
    <div class="row">
        <div class="col-xs-8 col-xs-offset-2 col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-4 text-center animated fadeInDown">
            <div>
                <h1 class="logo-name">My Orange</h1>
            </div>
            <h3>Welcome to My Orange</h3>

            <p>Perfectly designed and precisely prepared admin theme with over 50 pages with extra new web app views.
            </p>

            <p>Login in. To see it in action.</p>

            <form class="m-t" role="form" action="#">
                <div class="form-group">
                    <input type="email" class="form-control" placeholder="Username" required="">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="Password" required="">
                </div>
                <button type="submit" class="btn btn-primary btn-block m-b">Login</button>

                <a ui-sref="account.forgot">
                    <small>Forgot password?</small>
                </a>

                <p class="text-muted text-center">
                    <small>Do not have an account?</small>
                </p>
                <a class="btn btn-sm btn-white btn-block" ui-sref="account.register">Create an account</a>

                <br/>

                <google-signin></google-signin>

                <facebook-signin></facebook-signin>

                <br/>
            </form>
            <p class="m-t">
                <small>My Orange app framework base on Bootstrap 3 © 2014</small>
            </p>
        </div>
    </div>
</div>

0 个答案:

没有答案