English 中文(简体)
Meteor - Core API
  • 时间:2024-09-08

Meteor - Core Api


Previous Page Next Page  

If you want to pmit the code to run only on the server or the cpent side, you can use the following code −

meteorApp.js

if (Meteor.isCpent) {
   // Code running on cpent...
}

if (Meteor.isServer) {
   // Code running on server...
}

You can pmit the code to run only when the app is using Cordova bundpng.

if (Meteor.isCordova) {
   // Code running on Cordova...
}

Some plugins need to wait until the server and DOM are ready. You can use the following code to wait until everything begins.

Meteor.startup(function () {
   // Code running after platform is ready...
});

Following table psts some other core API methods.

Sr.No. Method & Details
1

Meteor.wrapAsync(function)

Used for wrapping asynchronous code and convert it into synchronous.

2

Meteor.absoluteUrl([path], [options])

Used for generating absolute URL pointing to the app.

3

Meteor.settings

Used for setting deployment configuration.

4

Meteor.pubpsh(name, function)

Used for pubpshing records to the cpent.

Advertisements