meteor - lukemadera:autoform-googleplace -
i've installed lukemadera:autoform-googleplace
package , followed usage instructions. when run application address field doesn't auto populate type. error in console (exception in template helper: referenceerror: ejson not defined)
can please tell me i'm missing.
path: layout.html
<head> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places"></script> </head>
path: schema.js
schema.address = new simpleschema({ fulladdress: { type: string }, lat: { type: number, decimal: true }, lng: { type: number, decimal: true }, geometry: { type: object, blackbox: true }, placeid: { type: string }, street: { type: string, max: 100 }, city: { type: string, max: 50 }, state: { type: string, regex: /^a[lkszraep]|c[aot]|d[ec]|f[lm]|g[au]|hi|i[adln]|k[sy]|la|m[adehinopst]|n[cdehjmvy]|o[hkr]|p[arw]|ri|s[cd]|t[nx]|ut|v[ait]|w[aivy]$/ }, zip: { type: string, regex: /^[0-9]{5}$/ }, country: { type: string } }); schema.userprofile = new simpleschema({ address: { type: schema.address, optional: true } });
path: personaldetails.js
<template name="personaldetails"> {{#autoform collection="meteor.users" id="candidateprofile" doc=currentuser type="update"}} {{> afquickfield name="profile.address" type="googleplace" opts=optsgoogleplace}} {{/autoform}} </template>
path: personaldetails.js
template.personaldetails.helpers({ optsgoogleplace: function() { return { // type: 'googleui', // stoptimeoutonkeyup: false, // googleoptions: { // componentrestrictions: { country:'us' } // } } } });
fyi, in case else gets error, need install ejson.
Comments
Post a Comment