Skip to content

How to get Firebase server timestamp? #211

@meshekhar

Description

@meshekhar

I want to save date to the firebase server with server generated timestamp using Firebase module 'Firebase.ServerValue.TIMESTAMP'.

How can I configure to import Firebase as module. I am using angular-cli and following are the configuration settings.

**System-config.ts**
/** Map relative paths to URLs. */
const map: any = {
    firebase: 'vendor/firebase/lib/firebase-web.js',
    angularfire2: ' vendor/angularfire2'
};
/** User packages configuration.*/
const packages: any = {
      angularfire2: {
        defaultExtension: 'js',
        main: 'angularfire2.js'
      }
};

**angular-cli-build.js**

/* global require, module */
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
  return new Angular2App(defaults, {
    vendorNpmFiles: [
      'systemjs/dist/system-polyfills.js',
      'systemjs/dist/system.src.js',
      'zone.js/dist/**/*.+(js|js.map)',
      'es6-shim/es6-shim.js',
      'reflect-metadata/**/*.+(js|js.map)',
      'rxjs/**/*.+(js|js.map)',
      '@angular/**/*.+(js|js.map)',

      // below are the AngularFire entries
      'angularfire2/**/*.js',
      'firebase/lib/*.js'      
    ]
  });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions