Last active
June 9, 2016 19:00
-
-
Save aabril/09e9c037215c8c9633dbd6cb43ed7c90 to your computer and use it in GitHub Desktop.
angular-component approach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| angular.module('MerchantApp').component('bookingPickup', { | |
| bindings: { | |
| booking: '=', | |
| display: '=', | |
| actions: '=' | |
| }, | |
| controller: ['uiGmapGoogleMapApi', function(uiGmapGoogleMapApi) { | |
| var Ctrl = this; | |
| var displayModel = { | |
| companyName : "", | |
| address: "", | |
| name: "", | |
| email: "", | |
| phone: "" | |
| }; | |
| var uiactions = { | |
| companyName : { | |
| change : function(){ | |
| console.log(new Date(), "pickup.actions.companyname.change"); | |
| } | |
| }, | |
| address: { | |
| change: function(){ | |
| console.log(new Date(), "pickup.actions.address.change"); | |
| } | |
| }, | |
| name: { | |
| change: function(){ | |
| console.log(new Date(), "pickup.actions.name.change"); | |
| } | |
| }, | |
| email: { | |
| change: function(){ | |
| console.log(new Date(), "pickup.actions.email.change"); | |
| } | |
| }, | |
| phone: { | |
| change: function(){ | |
| console.log(new Date(), "pickup.actions.phone.change"); | |
| } | |
| } | |
| }; | |
| var Helpers = { | |
| activateGoogleMapsAutocomplete: function(){ | |
| uiGmapGoogleMapApi.then(function(maps) { | |
| var ps = document.getElementById('pickup-search'); | |
| var PsearchBox = new maps.places.Autocomplete(ps, {}); | |
| console.log(PsearchBox); | |
| }); | |
| } | |
| }; | |
| Ctrl.$onInit = function(){ | |
| Ctrl.display.pickup = displayModel; | |
| Ctrl.actions.pickup = uiactions; | |
| Helpers.activateGoogleMapsAutocomplete(); | |
| }; | |
| }], | |
| templateUrl: 'views/booking/booking-pickup.html' | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment