UI Bootstrap模式文本不显示

时间:2016-09-22 19:15:30

标签: javascript html angularjs angular-ui-bootstrap angular-ui-modal

我有这个角度项目,并且在登录页面上有一个下拉列表,您可以登录或注册。当您单击注册按钮时,它会打开一个模式,允许您输入信息。问题是我放在模态中的任何文本都没有显示出来。按钮内的文本显示但不显示任何其他文本。有什么想法吗?

登录页面模板

<div class="btn-group">
    <button class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <span class="glyphicon glyphicon-chevron-down"></span>
    </button>
    <ul class="dropdown-menu start-dropdown-btn">
        <li><a href="#">Signin with Username</a></li>
        <li><a href="#">Signin with <i class="fa fa-facebook" aria-hidden="true"></i></a></li>
        <li><a ng-click="registerWithUsername()" href><span class="text-success bold">Register now!</span></a></li>
     </ul>

</div>

模态模板

<script type="text/ng-template" id="registerModal.html">
<div class="modal-body">
    <input id="registerUsername" placeholder="Enter Your Username" type="text" class="form-control top-spacer" ng-model="user.username" >
    <input id="registerPassword" placeholder="Enter Your Password" type="password" class="form-control top-spacer" ng-model="user.password">

</div>
<div class="modal-footer">
    <div class="btn-block">
        <button class="btn btn-success" ng-click="register(user)">Sign Up</button>
        <button class="btn btn-default" ng-click="close()">Cancel</button>
    </div>
    <div role="alert" class="alert alert-info" ng-show="registrationSuccessMessage"></div>
</div>
</script>

打开模态的登录控制器

$scope.registerWithUsername = function(){
        var modalInstance = $uibModal.open({
            animation: true,
            templateUrl: 'registerModal.html',
            size: 'sm',
            controller: 'RegisterCtrl',
            resolve: {
                minutes: function(){
                    return $scope.settings
                }
            }
        })
    }

模态控制器

$scope.register = function(user_info){

        $scope.loading = true

        Register.save({
            username: user_info.username,
            password: user_info.password,
        })
}

0 个答案:

没有答案