-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathphone.js
More file actions
27 lines (23 loc) · 775 Bytes
/
phone.js
File metadata and controls
27 lines (23 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var app = angular.module('phoneApp', []);
app.controller('AppCtrl', function($scope) {
$scope.leaveVoicemail = function(number, message) {
console.log('Number: ' + number + ' said: ', message);
}
});
app.directive('phone', function() {
return {
restrict: "E",
scope: {
number: '@',
network: '=',
makeCall: '&',
},
template: '<div class="panel">Number: {{number}} Network:<select ng-model="network" ng-options="net for net in networks"></select>' +
'<input type="text" ng-model="value">' +
'<div class="button" ng-click="makeCall({number: number, message: value})">Call</div></div>',
link: function (scope) {
scope.networks = ["Rogers", "Telus", "Bell"];
scope.network = scope.networks[0];
}
}
})