前端 - angular报错?

查看:67
本文介绍了前端 - angular报错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <script src="js/rem.js"></script>
    <script src="js/Angular.js"></script>
    <title>longin</title>
    <style>
        body{
            padding-top:1.5rem;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 16px
        }
        input{
        }
    </style>
</head>
<body>
    <div class="con" ng-controller="defaultCtrl">
        <h1>律所SaaS系统</h1>
        <div class="longin">
            <h3>登录</h3>
            <div class="phoneNub">
                <span>手机号</span>
                <input type="number"  ng-model="phone" ng-change="check()">
            </div>
            <div class="yzm">
                <span>验证码</span>
                <input type="number" name="" ng-model="yzm">
                <a href="" class="fsyz">获取验证码</a>
            </div>
            <a href="" class="loginTo">登录</a>
        </div>
    </div>
</body>
<script>
    angular.module("app",[])
    .controller("defaultCtrl",['$scope',function($scope){
        $scope.phone="",
        $scope.yzm="",
        $scope.check = function(){
            console.log("2")
            if(/^1(3|4|5|7|8)\d{9}$/.test($scope.phone)){
                alert("1")
            }
        }

    }])
</script>
</html>

报错VM366:158 Uncaught TypeError: Cannot read property 'description' of undefined

解决方案

确定是angular报的错?检查下rem.js吧

这篇关于前端 - angular报错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆