相关疑难解决方法(0)

在JavaScript中创建GUID/UUID?

我正在尝试在JavaScript中创建全局唯一标识符.我不确定所有浏览器上有哪些例程,"随机"和内置随机数生成器的种子等等.

GUID/UUID应至少为32个字符,并应保持在ASCII范围内,以避免传递它们时出现问题.

javascript uuid guid

3915
推荐指数
46
解决办法
166万
查看次数

提交按钮不工作AngularJS

所以基本上我要做的是输入两个数字n1和n2,然后使用angular打印它们的总和.我用过bootstrap来造型.但是我注意到没有发生任何事情,所以检查我alert()在要调用的函数中添加了函数,但仍然没有以某种方式访问​​它.我不懂jQuery.

PS:当我使用text1+text2它时,将字符串合并而不是打印总和

这是我的HTML:

<!DOCTYPE html>
<html ng-app="store">
  <head >
    <title>Trying Angular</title>

    <link rel="stylesheet" type="text/css" href="bootstrap/dist/css/bootstrap-theme.css">
    <link rel="stylesheet" type="text/css" href="bootstrap/dist/css/bootstrap.min.css">
  </head>
  <body>
    <form class="form-inline" style="border: 2px solid blue; max-width:500px;" ng-controller="formCtrl as formCtrl" ng-submit="formCtrl.submit()">

    <div class="form-group">
      <label>Enter n1</label>
      <input type="text" class="form-control" placeholder="enter the first number" ng-model="text1">
      <p>{{ text1}}</p>
    </div>


    <div class="form-group">
      <label>Enter n2</label>
      <input type="text" class="form-control" placeholder="enter the second number" ng-model="text2">
      <p >{{text2}}</p>

    </div>
    <div class="form-group"  style="display:block; margin:10px auto; margin-left:370px;">
      <input type="submit" class="form-control"  >
    </div>

     <p>  Your SUM …
Run Code Online (Sandbox Code Playgroud)

javascript twitter-bootstrap angularjs angularjs-directive angularjs-scope

4
推荐指数
1
解决办法
1万
查看次数