Javascript TypeError:无法分配给只读属性';确认成功url';
除了Firefox的名为“ng token auth”的之外,所有浏览器的角度模块都有问题。在rails服务器上,我使用gem“Desive token auth”,它与angular模块无缝协作,创建API令牌身份验证框架 我遇到的问题与Javascript TypeError:无法分配给只读属性';确认成功url';,javascript,ruby-on-rails,angularjs,devise,Javascript,Ruby On Rails,Angularjs,Devise,除了Firefox的名为“ng token auth”的之外,所有浏览器的角度模块都有问题。在rails服务器上,我使用gem“Desive token auth”,它与angular模块无缝协作,创建API令牌身份验证框架 我遇到的问题与$auth.SubmitRegistration()方法有关。按照在my users_registration.com中github()上发布的示例,我通过变量将表单数据(转换为JSON)发送到SubmitRegistration()函数,然后将其发布到rai
$auth.SubmitRegistration()
方法有关。按照在my users_registration.com中github()上发布的示例,我通过变量将表单数据(转换为JSON)发送到SubmitRegistration()函数,然后将其发布到rails(由Desive token auth处理)gem
但是,在提交表单时,在发布任何数据之前,会立即抛出一个javascript错误,说明:TypeError:Cannot assign to只读属性“confirm\u success\u url”
用户注册咖啡(控制器):
form.html:
<form ng-submit="handleRegBtnClick()" role="form" ng-init="registrationForm = {}">
<div class="form-group">
<label for="first_name">First Name</label>
<input type="first_name"
name="first_name"
id="first_name"
ng-model="registrationForm.first_name"
required="required"
class="form-control">
</div>
........
<div class="form-group">
<label for="email">Email</label>
<input type="email"
name="email"
id="email"
ng-model="registrationForm.email"
required="required"
class="form-control">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password"
name="password"
id="password"
ng-model="registrationForm.password"
required="required"
class="form-control">
</div>
<button type="submit" class="btn btn-primary btn-lg">Register</button>
</form>
名字
........
电子邮件
密码
登记
所以我最终解决了这个问题。问题来自于使用JSON.stringify
,而我需要使用angular.extend
parameter = angular.extend(
zone_id: r.zone_id
.....
我没有意识到,但是confirm\u success\u url
是一个参数,它会与数据一起自动添加,因此在其他参数未包含它之前
无论如何,它现在可以在所有浏览器中工作
parameter = angular.extend(
zone_id: r.zone_id
.....