This file contains 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
@NgModule({ | |
declarations: [AppComponent], | |
imports: [ | |
BrowserModule | |
], | |
providers: [ | |
{ | |
provide: HTTP_INTERCEPTORS, | |
useClass: NetworkInterceptor, | |
multi: true |
This file contains 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
Angular CLI version | Angular version | Node.js version | TypeScript version | |
---|---|---|---|---|
- | 2.x | 6.0.x or later minor version | 2.0.x | |
1.0.6 | 4.0.x/4.1.x | 6.9.x or later minor version | 2.2.x | |
1.1.3 | 4.0.x/4.1.x | 6.9.x or later minor version | 2.3.x | |
1.2.7 | 4.0.x/4.1.x | 6.9.x or later minor version | 2.3.x | |
1.3.2 | 4.2.x/4.3.x/4.4.x | 6.9.x or later minor version | 2.4.x | |
1.4.10 | 4.2.x/4.3.x/4.4.x | 6.9.x/8.9.x or later minor version | 2.4.x | |
1.5.6 | 5.0.x/5.1.x | 6.9.x/8.9.x or later minor version | 2.4.x/2.5.x | |
1.6.7 | 5.2.x | 6.9.x/8.9.x or later minor version | 2.5.x | |
1.7.4 | 5.2.x | 6.9.x/8.9.x or later minor version | 2.5.x |
This file contains 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
<?xml version='1.0' encoding='utf-8'?> | |
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> | |
<name>i4-sidemenu</name> | |
<description>An awesome Ionic/Cordova app.</description> | |
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author> | |
<content src="index.html" /> | |
<access origin="*" /> | |
<allow-intent href="http://*/*" /> | |
<allow-intent href="https://*/*" /> | |
<allow-intent href="tel:*" /> |
This file contains 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
if (window.navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(function (position) { | |
var lat = position.coords.latitude, | |
lng = position.coords.longitude, | |
latlng = new google.maps.LatLng(lat, lng), | |
geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({'latLng': latlng}, function(results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
if (results[1]) { | |
for (var i = 0; i < results.length; i++) { |
This file contains 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
_getCityState = function(resp){ | |
var res = ''; | |
if (resp.status == 'OK') { | |
if (resp.results[1]) { | |
var city=false,state=false; | |
for (var i = 0; i < resp.results.length; i++) { | |
if ((!city || !state) && resp.results[i].types[0] === "locality") { | |
city = resp.results[i].address_components[0].short_name, | |
state = resp.results[i].address_components[2].short_name; | |
res = city + ", " + state; |
This file contains 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
// source: http://stackoverflow.com/questions/16491758/remove-objects-from-array-by-object-property | |
// we have an array of objects, we want to remove one object using only the id property | |
var apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}]; | |
// get index of object with id:37 | |
var removeIndex = apps.map(function(item) { return item.id; }).indexOf(37); | |
// remove object | |
apps.splice(removeIndex, 1); |
contact-information.component.html
:
<div id="ContactInput" fxLayout="column" [formGroup]="contactForm">
<mat-form-field appearance="standard" fxFlex color="accent">
<mat-label>{{'ContactInformation.customer_name_heading' | translate}}</mat-label>
This file contains 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
/** | |
* Generates number of random geolocation points given a center and a radius. | |
* @param {Object} center A JS object with lat and lng attributes. | |
* @param {number} radius Radius in meters. | |
* @param {number} count Number of points to generate. | |
* @return {array} Array of Objects with lat and lng attributes. | |
*/ | |
function generateRandomPoints(center, radius, count) { | |
var points = []; | |
for (var i=0; i<count; i++) { |
This file contains 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
var dataset = [2,2,4,2,6,4,7,8]; | |
var search = 2; | |
var count = dataset.reduce(function(n, val) { | |
return n + (val === search); | |
}, 0); | |
console.log(count); |
NewerOlder