Menu
  • HOME
  • TAGS

Calendar Month and Year Not changing on dropdown year and month

meteor,fullcalendar,semantic-ui

After your template with class calendar has been added to the HTML you can use $('#myCalendar'). If the calendar is already rendered you can't use: $('#myCalendar').fullCalendar({gotoDate: moment(Session.get('date'))}); To go to a date you might want to call: $('#myCalendar').fullCalendar('gotoDate', moment(Session.get('date'))); ...

Pass router parameters in Router.go()

meteor,iron-router

Read about it here Router.route( '/admin/users/details/:userID', { name: 'admin.details', ... } ); Template.AdminUsersDetailsDetailsForm.events({ "click #form-back-button": function(e, t) { e.preventDefault(); Router.go('admin.details', {userId:'USER_ID'}); } You can generate url using: Router.path('admin.details', {userId:'USER_ID'}); ...

Insert data in collection at Meteor's startup

javascript,json,meteor,data,startup

Ok, you'll want to check out Structuring your application. You'll have to make the file with the definition load earlier, or the one with the fixture later. Normally you have your collections inside lib/ and your fixtures inside server/fixtures.js. So if you put your insert code into server/fixtures.js it'll work....

CKeditor outputs Html. How to format it for displaying properly, not just lame html?

javascript,html,css,meteor,ckeditor

You use triple braces in spacebars for this. So your answer is {{{body}}} ...

Getting User Birthday HTTP Request

facebook,facebook-graph-api,meteor

This would be correct: https://graph.facebook.com/me?fields=birthday&access_token=[your-user-token] You should start reading the Facebook docs about Access Tokens and API endpoints. You can test the API with the API Explorer....

Testing Meteor packages with Velocity?

meteor,jasmine,meteor-velocity

Yes, it is possible to test packages with sanjo:jasmine. It works in nearly the same way as with TinyTest. You can find all information to get started in the sanjo:jasmine README. There is also an example package. To run the tests, use the commands from the README. If you need...

XMLHttpRequest to Restivus API

javascript,meteor,xmlhttprequest,cross-domain,cors

The answer is more than obvious after finding out. I just need to to set the options method in the restivus route to authRequired: false. You cannot send a complete header with credentials when doing a preflight. Now I am first doing the preflight and then sending the real post.

How to set up a meteor server on https connection?

ssl,meteor,https

Deploy the app using Meteor Up which have built in SSL support. Or use common web server like Nginx or Apache, setup SSL and reverse proxy back to meteor app. Example: Nginx configuration server { listen 80; server_name www.example.com; rewrite ^ https://$server_name$request_uri? permanent; } server { listen 443 ssl ;...

How can I add this function in my Meteor project

javascript,jquery,meteor

Plugins should be initialized in your template's onRendered callback. For example: Template.myTemplate.onRendered(function() { $(".typedelement").typed({ strings: ["You don't have any projects yet", "Start by adding a project."], typeSpeed: 0 }); }); ...

how to scan a barcode image in a meteor application

meteor

To get barcode scanning capability, use BarcodeScanner cordova plugin: meteor add cordova:[email protected] Template <head> <title>Barcode Scanner</title> </head> <body {{> barcode_scanner}} </body> <template name="barcode_scanner"> <button>Scan</button> </template> JS if (Meteor.isCordova) { Template.barcode_scanner.events({ 'click button': function () { cordova.plugins.barcodeScanner.scan( function (result) { alert("We got a barcode\n" + "Result: " +...

Passing a parameter into Meteor Template Helper

meteor,spacebars

You cannot call helpers with arguments in an #if. I assume that the template instance's data context is a Unit document because of your use of this._id. If so, can just do; {{#if profile}} {{profile}} {{/if}} The #if checks whether its argument is truthy....

MeteorJS Blaze.getData() occasionally returns undefined

meteor,meteor-blaze

It turns out the issue was within the click event. I had a nested span element within my share-course button: <small class="share-course" data-courseid="{{_id}}"> Share <span class="glyphicon glyphicon-share"></span> </small> This was messing up the way I was targeting my embedded courseID Instead of Blaze.getData(), I should have also been using Template.currentData()...

Working with embedded documents in MongoDB

javascript,mongodb,meteor

In keeping with your current schema (not recommended): First, save the entire document to the client: doc = { _id: 1, projectName: name, managers: [ { managerId: "manager1", status: false, startDate: "startDate", endDate: "endDate" }, { managerId: "manager2", status: false, startDate: "startDate",endDate: "endDate" }, { managerId: "manager3", status: true, startDate:...

How to reuse layoutTemplate between routes?

meteor,iron-router

There's something abnormal about my app, because IR doesn't normally rerender the layout between routes: http://meteorpad.com/pad/qcu8QWASvPEjDEf5k/IR...

how to prevent error: [ng:btstrpd] App Already Bootstrapped with this Element 'document'

angularjs,meteor,angular-meteor

Issue is with file path of index.ng.html in index.html's ng-include It should be <div ng-include="'client/index.ng.html'"> </div> Path are always absolute , as mentioned in Angular Meteor tutorial It's very important to note - the paths are always absolute, not relative! so if 'index.ng.html' was inside a client folder, you would...

Use a “months” array to perform calculations for each month in a for loop

javascript,arrays,meteor,meteor-helper

I think you want to get the properties from your currentProject object by using the month as a key. Like this: var months = ["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","des"]; var arrayLength = months.length; var rtcw = {}; for (var i = 0; i < arrayLength; i++) { alert(months[i]); // Need to Calculate rtcw for...

Access binaries inside docker

ubuntu,meteor,docker

It doesn't seem to be configurable at the moment based on this open issue. However, you could always fork the project and modify the start script to use your own custom docker image. If so, make sure you make it: FROM meteorhacks/meteord:base ...

Disabling tail.sh for specific server ( or environment )?

javascript,meteor

I think this feature should be disabled for dev environments. It will probably be done so :] Not sure if this counts as an answer. I made a GH ticket to track the progress until its updated: https://github.com/Tarang/Meteor-Analytics/issues/28...

add subitems to meteor document

mongodb,meteor,collections,insert-update

Give something like this a try: // fetch the current list var list = Lists.findOne(_currentListId); // find the number of existing items and handle the case where there are none var numItems = (list.items || []).length; // the the next item key will be one more than the length var...

How to get the data object from a certain template instance in Chrome Console in Meteor?

meteor

You want to check out Blaze.getData and Blaze.getView. With Blaze.getData you can simply do this: Blaze.getData(document.querySelector('.someelement')) This works pretty well, but you have to have an element inside the template-instance you can query for....

Cannot connect to MongoDB inside a template

meteor

You cannot attach helpers to body. Helpers have to be attached to a template. What you should do is this: in the HTML: <body> {{> membersList}} </body> <template name="membersList"> <ul> {{#each members}} <li>{{name}}</li> {{/each}} </ul> </template> In the JS: Template.membersList.helpers({ members: function() { return Members.find(); } }); ...

Why are my meteor settings not being passed to the application?

meteor,meteor-helper

From what I understand the environment variable is only for the deployment mode (running a bundle). In development, i.e., when running meteor, you need to use the --settings command line parameter to specify a file containing the settings....

How to count the current number of subscriptions to a meteor publication

meteor

I didn't see anything in the docs how to do it better than your idea. There's another possible approach shown below which iterates over these subscription objects : https://github.com/meteor/meteor/blob/devel/packages/ddp-server/livedata_server.js#L241 You can try it by putting the below code in your Server meteor code. Meteor.setInterval(function(){ var output = {}; var connections...

How can I dynamically set router options in a Meteor application using the iron router package?

meteor,iron-router

Router.route("/:name", { name: "home", template: "home", data: function(){ // this will create a new key myName on the route object for this route // and set the value to the name that the user entered in the path this.route.options.myName = this.params.name; return { label: this.params.name }; } }); // All...

Turning the Stripe Checkout into a Synch function

meteor,stripe-payments

This should work and result should populate with a result as you see in the stripe documentation: var result = stripeChargesCreateSync({ source: stripeToken, amount: (info.timeRequired/15)*500, // this is equivalent to $50 currency: 'gbp' }); This is where the error is, use this: var stripeChargesCreateSync = Meteor.wrapAsync(Stripe.charges.create, Stripe.charges); instead of var...

Meteor with Semantic UI dropdown behavior not working

jquery,meteor,semantic-ui

jQuery plugins need to be initalized when the corresponding HTML elements have been inserted in the DOM, which is usually the case in standard server side rendered webapps, but Meteor takes a different approach by using client side reactive templating, all the HTML generation is done in the browser. This...

Using a helper with arguments AS a helper argument in Spacebars

meteor,spacebars

I think that you cannot chain two helpers with parameters on the second one like you did. Subsequent parameters will still be interpreted as parameters from the first helper. I see two ways for solving this problem: 1) you could get rid of the parameters and use the data context...

MeteorJs mobile-config settings for landscape only?

javascript,android,ios,meteor,mobile-application

After searching on the topic i came to conclusion that its an open bug and only way to prevent portrait mode on apple's ipad is by manually editing the settings through XCode. You can check out but here ...

Meteor: group documents and publish an object

javascript,meteor

It depends of you want to do it on client or server. First, the obvious solution: if you have no specific reason to store them with the first structure, store them directly using the second. Second, another easy solution is to make in client. Here is a non tested code...

Convert ng-click to Blaze in meteoric

angularjs,meteor,ionic-framework,meteor-blaze,meteoric

Try to set up a template around your html: <template name="myTemplate"> <div class="list"> <a id="myDiv" class="item item-icon-right nav-clear" href="#/app/list1"> <i class="icon ion-ios7-paper"></i> Item 1 </a> .... </div> </template> Then put this code into your js file: Template.myTemplate.events({ "click #myDiv": function( event) { // yourFunction }, }); ...

change collection data formats within Meteor

mongodb,meteor

Generally I prefer to run migration scripts from the mongo shell since it's easier to execute (compared to deploying the code that runs the migration) and it gives you access to the full mongo api. You can run load(path/to/script) in the mongo console if you want to pre define your...

Dopdownlist is being populated with limited values instead of values from total collection

javascript,meteor,meteor-helper

First, just to be sure I understand your situation, let me rephrase it: You have a collection of documents that you want to sort using categories (which are stored for each document in a dedicated field). On one hand, you want to build a dropdown using all the possible categories...

Is it possible to insert(not update) a field name as variable in Mongodb?

javascript,mongodb,meteor

Something like this should work: 'submit form' : function(event){ event.preventDefault(); var query=document.getElementsByClassName("twilioProcessorsms")[0].value; var valueToInsert = { sms: esms }; valueToInsert[query] = { accountSID: accsid, authToken: token, phoneNumber: phno} }; ChoiceList.insert(valueToInsert); ...

Iron Router URL Extension

meteor,iron-router

The pathFor helper takes the params for the URL from the context it is called from. So in your case it will search for username inside the userProfile-template instance. So there are two ways of going about this. You could add username to the data context Use a spacebars with-block...

Restricting The Viewing of Forms Per User

javascript,twitter-bootstrap,meteor

That's something you need to deal with using your publications/subscriptions. See here and here for learning ressources. Basically, what should happen is that when user A creates a form (or any object), you store it into a collection along with the user id (Meteor.userId()). You subscribe to a publication in...

How can I query an FS collection in Meteor from the command line?

database,image,mongodb,meteor,collectionfs

Go to the Meteor Mongo console: meteor mongo See all the collections that are available: show collections Look for the one that has cfs.collection_name.files Choose the one that has your collection name. For example, I'm using collectionFS with gridFS for images. When I type show collections, I see cfs_gridfs.images.files so...

jQuery component stop working when routing

meteor

I've seen a similar issue, it makes me think that when you are "changing pages" you are not actually "destroying" the template temp, as the selectpicker() doesn't get called again when you "change back". You don't show enough information to answer this accurately, but you can try Destroying the selectpicker()...

Meteor: onRendered doesn't get fired again after second render iron-route

javascript,meteor,iron-router

onRendered only fires when an instance of the template is added to the DOM, it will thereby not fire again on data changes. If you want to execute code once the data is ready you should use the template.autorun function like so: Template.profielBewerken.onRendered(function () { this.autorun(function (comp) { if (Meteor.user())...

Meteor.publish callback not being called

javascript,meteor

You need to subscribe it on client. This work for me: Boxes = new Meteor.Collection("boxes"); if (Meteor.isServer) { Meteor.startup(function () { Boxes.remove({}) //clearing the database Boxes.insert({ //adding one element to the database boxes: [1], currentId: 1 }); }); console.log("publish1") Meteor.publish("boxes", function() { console.log("publish2") //this does not run! ever! return Boxes.find();...

Meteor collection2 type Object

meteor,meteor-collection2

As far as I see it, you have two options: Store user-ids there with type: String Denormalize it as you proposed Denormalize it as you proposed To denormalize it you can do something like this inside your schema: ... modifiedBy: { type: object } 'modifiedBy._id': { type: String, autoValue: function...

Return contents of one field (an array) from Mongodb document in Meteor

javascript,mongodb,meteor

Try accessing the selections field of the document, that should give you the array directly, not the entire document: var selected = Charts.findOne({_id:this._id}, {selections:1, _id:0}); would give you { "selections": ["A","B"] } But var selected = Charts.findOne({_id:this._id}, {selections:1, _id:0}).selected; will give you the needed array ["A","B"] ...

How can I assign data context in onCreated

javascript,meteor

this.data is immutable. To replace the data context either wrap your mine template and pass the correct data. E.g.; <template name="mineWrap"> {{> mine mydata}} </template> Or, store your data directly on the template instance. E.g.; Template.mine.onCreated(function () { this._myData = 'data'; }); Template.mine.helpers({ myData: function () { return Template.instance()._myData; }...

Meteor - Multiple data contexts with Iron Router

meteor,iron-router

Your data object declaring syntax is wrong, it should be : this.render('PackageDetails', { data: { package: package, listItems: listItems } }); Then in your template, you can reference the data context using {{package.property}} and {{#each listItems}}....

Meteor - Requests randomly failing

meteor,request-cancelling

Finally found the source of my problem maybe my answer would help other Meteor developers. I used to do this : var providersSub = Meteor.subscribe('providers'); Tracker.autorun(function () { if(!providersSub.ready()) return; var providerIds = _.pluck(Provider.all().fetch(), '_id')); ... this.stop(); }); Instead of : var providersSub = Meteor.subscribe('providers'); Tracker.autorun(function (computation) { if(!providersSub.ready()) return;...

Iron Router OnBefore Hook with Params URL Not Calling Function

meteor,iron-router

Turns out that for routes with "/" you need to use ".". So in this case I used: only: ["challenge.:_id"] Problem solved!...

Meteor.users.find() - how to filter by group in alanning:roles package

meteor,mongodb-query,roles,groups

This code has about a 5% chance of working out of the box because I have no collection to test this on, I have no way of running this code, I don't have the roles package, I don't have your users database, and I've never done .map on a cursor...

Meteor file upload with Meteor-CollectionFS giving error method not found

meteor

Make sure you also define this collection on the server side: Uploads =new FS.Collection('uploads',{ stores: [new FS.Store.FileSystem('uploads',{path:'~/projectUploads'})] }); The reason it can't find the method is the collection isn't defined on the server side (in the /server folder) or in a block of code that runs in if(Meteor.isServer) { instead...

How do you use the meteor-accounts-t9n package?

javascript,meteor,package,translation

As far as I know, in terms of translations for account-related UI elements (buttons, links, placeholders and so on), meteor-accounts-t9n is set to work with the meteor-useraccounts packages. (core and framework-specific, such as bootstrap, foundation, ratchet...) With the meteor-useraccounts packages installed and in use (using {{> atForm}}), all you need...

Get json values from key-value pair without passing keys in meteor

javascript,json,mongodb,meteor

JS Template.test.helpers({ itemsArray: function(){ // This would normally be the result of your Mongo query var itemsArray = [ { "_id": "SXTJBs7QLXoyMFGpK", "Brand": "Nike", "Material": "Cooton", "Price": "67484", "ComboId": "y23", "Color": "White", "LaunchDate": "08/02/2015", "DiscountActiveDate": "08/03/2015", "DiscountInactiveDate": "08/04/2015", "Category": "Sport", "ProductSubCategory": "trackpant", "Status": "Pending", "TemplateID": "557fc7d06ecb48d38a67a380" }, { "_id": "IGJHihljiUYG6787y",...

Meteor mupx ssl configuration is not working, still routing to port 80

javascript,ssl,meteor,docker

You're welcome! I initially forgot to post it here too. We all need recognition when we can get it, thanks. I found this quote somewhere, sounds like a starting point to check...I n your EC2 control panel, look at your instance and note the Security Group that is assigned to...

Meteor: How can I show questions only asked by users with the field 'active'

performance,mongodb,meteor

You have a couple of options, but the easiest is just to mark the questions as inactive as soon as their author becomes inactive. Here's an example deleteUser method: Meteor.methods({ deleteUser: function() { // mark the user as inactive Meteor.users.update(this.userId, {$set: {isInactive: true}}); // mark the user's questions as inactive...

Filtering records according to dropdownlist

meteor,meteor-helper

You need to enforce the filters one after the other. Try like that: var filterAndLimitResults = function (cursor) { if (!cursor) { return []; } var raw = cursor.fetch(); var currentChosenCategory = chosenCategory.get(); var currentChosenCity = chosenCity.get(); var currentJtype = chosenJtype.get(); console.log(currentChosenCategory); console.log(currentChosenCity); // filter category var filtered = [];...

Meteor: Passing Session values from client to server

javascript,node.js,session,meteor

I don't really understand your need. Why do you want to share Session with Server ? Session is client-side only, but you can send value if your session with Meteor Methods, or in your subscription. In the second case, your sbscription can be reactive with the Session dependancy. Could you...

How to test a meteor method that relies on Meteor.user()

testing,meteor,jasmine

In your jasmine test you can mock a call to Meteor.user() like so: spyOn(Meteor, "user").and.callFake(function() { return 1234; // User id }); ...

DB relationship: implementing a conversation

mongodb,meteor

It all depends on usage patterns. First, you normalize: 1 conversation has many messages, 1 message belongs to 1 conversation. That means you've got a 1-to-many (1:M) relationship between conversations and messages. In a 1:M relationship, the SQL standard is to assign the "1" as a foreign key to each...

How do I make a slight modification to a package locally in Meteor?

javascript,meteor

Create a packages/ directory at the top level directory of your app (myapp/packages) and simply git clone the package you want to modify into it. Add the package via meteor add and you'll be able to edit the files of the package you just cloned. ...

Using Meteor.call inside a server router

meteor

Just restructure your method where you also name the function of the method, then you have two entry points into whatever code it is you'd like to execute: addUser = function() { ... }; Meteor.methods({'addUser': addUser}); Router.route('/sms/inbound', function () { if (something) { addUser({ name: "hello", age: 20 }); }...

How to reference a parent object via a variable?

javascript,meteor

Try insertIntoCollection(Services, serviceItems); .... With your previous code of "Services" being a string, you were essentially calling this in the function: "Services".insert(arrayOfObjects[index]); Which is obviously not the end result you want... On the side note, it's discouraged to use a key in object loop on arrays... Try looping through it...

Meteor Iron Router not loading template

javascript,meteor,iron-router

Your call to the Router.map function is unnecessary. It doesn't do much, as you can see here. Also you can omit the onBeforeAction hook if you're just calling this.next(). But I too, don't see anything wrong with your code. Here are some things you could try tho: Check if your...

Getting application folder path on MeteorJS?

javascript,web-applications,meteor,filepath

You are here: projectRoot/.meteor/local/build/programs/server/shell-server.js So, to reference a script that lives in a sibling folder of your project, it'll look something like this: ../../../../../../scriptFolder/script.rb...

Categories not found, Meteor subscription

node.js,meteor

To add to what Matt K said (because comments suck and there's really bad code formatting in comments), a possible example of code that creates a named collection and maintains synchronization of its data between the connected clients and the server: /lib/collections.js - runs on both server and client Categories...

Meteor router and url paramaters

javascript,meteor,iron-router

A few suggestions: this.route('home', { path: '/:_id', data: function() { // assuming you have a collection called "Threads" return Threads.findOne(this.params._id); } }); You need a template called 'home'. It's data context will be the return of the data callback You do not need to place a ? in the path...

Template.prototype.autorun() doesn't work inside a loop

meteor

Probably, the d index referenced in each autorun is the same one, therefore after the for loop, d ends up being equal to 7. It's apparently a common pitfall. An easy fix would be to call a self-invoking function within your for loop : ... for d in [0..6] do...

What is cursor?

meteor

The Meteor cursor is like a lazy version of the array of documents. It's designed to iterate through the results of a query while not actually loading each of the documents until they are actually requested or the cursor is at the position containing the document. Its better to think...

Meteor show spinner on method call

javascript,jquery,meteor,loading,publish-subscribe

The simplest solution is to activate the spinner in the event and deactivate it in the method call callback: 'click #methodButton' : function() { activateSpinner(); Meteor.call('method', function(ess, res) { if(err) throw err; deactivateSpinner(); }); } ...

How do I do an analog of a page scope in variable in Meteor?

meteor,meteor-helper

If you plan to use reactive data among several templates in the same page, I advise you to declare a reactive variable (ReactiveVar()) or a reactive dictionary At the beginning of your js file (if you have several, use the parent template file), outside any template.yourTemplate.rendered or template.yourTemplate.rendered, you declare...

meteor accounts-ui-bootstrap-3 email signup form does NOT show email field

meteor,meteor-accounts

Several issues: As pointed out by uZar accounts-base needs to be installed. Additionally, accounts needs to be configured on both the Client and server side. On the server: Meteor.startup(function(){ // setup to send email smtp = { username: 'xxxxx', // eg: [email protected] password: 'xxxxx', // eg: 3eeP1gtizk5eziohfervU server: 'xxxxx', //...

link helpers properties to a div in Meteor

javascript,meteor

Below you can find typical schema how to get data from database and display on client side. Please use it as inspiration. On the server side create publish function: Meteor.publish('article',function(articleId){ check(articleId, String); return Articles.find({_id:articleId}) }) routes.js Router.route(':categoryName/article/:_id',{ name:'full.article', template: 'fullArticle', waitOn: function () { return Meteor.subscribe( 'article', this.params._id ), },...

Error referring to the same Mongo.Collection from two .js files in Meteor

mongodb,meteor

You only need one new Mongo.Collection declaration per collection in meteor app.

Creating a button for Leaflet JS “panTo spot on map” outside of the map in Meteor

meteor,leaflet

You need to make map a global variable: var map = null; Template.dynamicmap.rendered = function() { var southWest = L.latLng(35.02035919622158, -121.21049926757814); var northEast = L.latLng(42.4426214924114, -110.79740478515624); var mybounds = L.latLngBounds(southWest, northEast); map = L.map('map_container',{zoomControl: false, ... ... ...

Creating meteor autoform w/ array of radio buttons

meteor,meteor-autoform

Yup! You can simple define arrays in SimpleSchema using this notation: ... 'problems': { type: String, autoform: { afFieldInput: { options: function () { return { one: 'one', two: 'two', three: 'three', four: 'four', five: 'five', six: 'six', } } } } } ... And in your template {{ >...

Router path for page navigation

meteor,iron-router

try the following in your router.js file Router.route('template1/template2',function() { this.render('template2'); }); ...

JavaScript/Node + cURL

javascript,node.js,curl,meteor

You could just use node's fs and https APIs var fs = require('fs'); var https = require('https'); var rs = fs.createReadStream( 'Calvin Harris - Thinking About You (Tez Cadey Remix)_165299184_soundcloud.mp3' ); var req = http.request({ hostname: 'api.idolondemand.com', path: '/1/api/async/recognizespeech/v1', method: 'POST' }, function(res) { // do something when you get...

Meteor reactive variables: Got my reactive computation + reactive source, but not reacting

meteor

You need to have a Session.set( "wordIds"... somewhere in that callback. If that doesn't change, your cursor in your helper won't change. Since your current cursor includes all the current docs, when you delete something it will react. PS, try doing away with the session var all together. Handle that...

Meteor function executes before publish and subscribe finishes loading collection

javascript,mongodb,meteor

The easiest way would be to do Template-level subscriptions. Template.myTemplate.onRendered(function() { var subscription = this.subscribe('publicationName', publicationArguments); } That is a very simplified way of doing it, but you should have no problems with your helper running first. Edit: The Discover Meteor blog has a great post about Template-level subscriptions. I...

Meteor method defined in lib, can't be found under server/lib

meteor

With respect to this issue, the load order rules work as follows: Paths containing lib gain priority. Paths gain priority based on their depth. Combining the two shows us that /server/lib/x.js will be loaded before /lib/x.js. With methods this shouldn't be an issue unless the method is invoked as soon...

Meteor: data passed to template from Iron Router, is empty at first load

meteor,iron-router

In the server folder, add publish.js and inside it add: Meteor.publish('hospitals', function() { return Hospitals.find({}); }); Then try subscribing to hospitals from your controller: WardAddController = RouteController.extend({ action: function() { this.render('addWard', { waitOn: function() { return [ Meteor.subscribe('hospitals') ]; }, data: function(){ return { hospitals : Hospitals.find({}), hospital_id : this.params._id...

Build a reactive publication with additional fields in each document

mongodb,meteor,meteor-publications

It's relatively easy to keep fields private even if they are part of the database query. The last argument to self.added is the object being passed to the client, so you can strip/modify/delete fields you are sending to the client. Here's a modified version of your fiddle. This should do...

issue with running Angle - Bootstrap Admin app (angular-meteor version): TypeError: $browser.addPollFn is not a function angular-cookies.js:60

angularjs,meteor,angular-meteor

Not sure about wrapbootstrap, but generally this error means you are using incompatible versions of angular and angular-cookies. The external angular modules you use (e.g. ngAnimate, ngCookies, ngResource, ngRoute etc), should always be the same version as angular.

How to exit a MeteorJS program from within code?

meteor,meteor-velocity

meteor --test is a Velocity command that is built-in to Meteor. You may want to use meteor --once so that Meteor does not restart

Meteor Iron Router resubscribe on Rights change with meteor-roles

meteor,iron-router

Say that the user is on a route /something You have some data that changes and you create a session variable: Session.set("someDataThatChanges", myChangedData) Your publish function takes some sort of input, which it uses to return different data from the collection: Meteor.publish("myCollection", function(input){ return myCollection.find( // do something here based...

Meteor/MongoDB limiting the result

mongodb,meteor

Meteor's collection API is somewhat different from that of the mongo API. find takes up to two parameters: a selector object, and an options object. options allows you to specify such things as sort, skip, limit and fields, in addition to the meteor-specific reactive and transform.

Use JSON file to insert data in database

javascript,json,mongodb,meteor,data

Simple use underscores _.extend function. Like this: var newProfile = _.extend( JSON.parse(Assets.getText('test.json')), {user: id} ) Profiles.insert(newProfile) ...

Meteor: Load scss files in a certain order

meteor,sass

Here you go: https://github.com/fourseven/meteor-scss Very popular and actively-managed package for SCSS users....

Meteor dynamic url explicit template finding path instead

javascript,meteor,iron-router,dynamic-url

You closed route ) without adding there the options object ( see , after ) ). That's why iron:router tries to generate template name from path: Router.route('/blog/:permalink'), { Should be: Router.route('/blog/:permalink', { template: 'blogPost', name: 'blogPost', path: '/blog/:permalink', data: function () { return Blogs.findOne({ permalink: this.params.permalink, published: true }); }...

how i add collaborators side-view in atmosphere?

meteor

You have to add maintainers to the package like this meteor admin maintainers <yourusername-or-organization:your-package> --add <collaborator-username> meteor admin maintainers iron:router --add mrt Then their name will be shown in collaborators/contributors list...

TypeError: Cannot read property 'slice' of null

meteor,meteor-autoform,meteoric

This is a issue with the new patch for autoform-ionic to the new versions of autoform. Apparently some labels are skipped, some not (see here). In order to fix that and avoid this error when your input type is not there (for example, type = number), all your schema fields...

Meteor - Query Embedded Documents

javascript,mongodb,meteor

Use fields (?): return MyCollection.find({},{fields:{"MWLink.LinkID": 1}}).fetch(); If you feel you need a bit more power on what comes up you can use map (?) or a transform (?): var transform = function(doc) { return { MWLink : { LinkID: doc.MWLink.LinkID } } } //A transform returns a cursor return MyCollection.find({},...

Meteor HTTP request structuring

javascript,http,meteor

This is the equivalent. It's a bit prettier in javascript. Server side code: var result = HTTP.post("https://api.locu.com/v2/venue/search", { data: { "fields": ["name", "menu_items", "location", "categories", "description"], "menu_item_queries": [{ "price": { "$ge": 15 }, "name": "steak" }], "venue_queries": [{ "location": { "locality": "San Francisco" } }], "api_key": "YOUR_API_KEY" } }); console.log(result.data);...

Meteor collections: how to connect to different collections referring to each other?

meteor,meteor-helper,meteor-collections

You might be better off using Contracts._id to refer to a contract from the Reminders collection that way if the contract name and description change at some point you won't need to update all the related reminders. Contract: { "_id": "tPN5jopkzLDbGypBu", "contract": "C-42432432", "description": "Description of contract", "counterpart": "Company name",...

Accessing parent helper in Meteor

javascript,meteor

There isn't an obvious way to do this in the current version of meteor. One solution is for the child template to "inherit" the helpers from the parent. You can do this pretty easily using meteor-template-extension. Here's an example: html <body> {{> parent}} </body> <template name="parent"> <h1>parent</h1> {{> child}} </template>...

How to return value in Meteor.JS from HTTP.call “GET”

javascript,ajax,http,meteor,facebook-javascript-sdk

Don't pass a callback to get the HTTP to return. You're also able to pass off URL parameters quite easily: var result = HTTP.call("GET", "https://graph.facebook.com/me", { params: { access_token : Meteor.user().services.facebook.accessToken, fields : "likes.limit(5){events{picture,cover,place,name,attending_count}}" } }); console.log(result); ...