我正在尝试添加 google hangouts 按钮以通过电子邮件拨打电话。如果我硬编码电子邮件按钮可以正常工作,但我可以使用字符串变量作为邀请 ID,以便我可以动态呈现 hongout 按钮吗?示例:邀请 [{ id : person.email }]。
<g:hangout render="createhangout"
invites="[{ id : 'foo@gmail.com', invite_type : 'EMAIL' }]">
</g:hangout>
这是中继器代码块。我错过了什么?
<ul>
<li data-ng-repeat="person in contacts | orderBy:'name'">
{{person.name}} {{person.surname | uppercase}} --> {{person.email}} - <button ng-click="del($index)">Delete</button>
<g:hangout render="createhangout"
invites="[{ id : '{{person.email}}', invite_type : 'EMAIL' }]">
</g:hangout>
</li>
</ul>
但我也在尝试更新和添加新人,以便动态创建视频群聊按钮。我认为我的主要问题是。这是所有代码。
<!DOCTYPE html>
<html data-ng-app="hangoutApp">
<body>
<div data-ng-controller="SimpleController">
<h2>Add a person to contact:</h2>
<br />
Enter Name:
<input type="text" data--ng-model="name" />
<br />
<br />
Enter Surname:
<input type="text" data--ng-model="surname" />
<br />
<br />
Enter Email:
<input type="text" data--ng-model="email" />
<br />
<br />
<button ng-click="addPerson()">Add New Person</button>
<br />
<br />
<ul>
<li data-ng-repeat="person in contacts | orderBy:'name'">
{{person.name}} {{person.surname | uppercase}} --> {{person.email}} - <button ng-click="del($index)">Delete</button>
<g:hangout render="createhangout"
invites="[{ id : '{{person.email}}', invite_type : 'EMAIL' }]">
</g:hangout>
</li>
</ul>
</div>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src="Scripts/angular.min.js"></script>
<script>
var hangoutApp = angular.module('hangoutApp', []);
var controllers = {};
controllers.SimpleController = function SimpleController($scope) {
$scope.name = "";
$scope.surname = "";
$scope.email = "";
$scope.contacts = [];
$scope.addPerson = function () {
this.contacts.push({
name: this.name,
surname: this.surname,
email: this.email
});
}
$scope.del = function (ind) {
this.contacts = this.contacts.splice(ind, 1);
};
}
hangoutApp.controller(controllers);
</script>
</body>