angular2-meteor

Meteor facebook login redirect doesn't work

家住魔仙堡 提交于 2020-01-26 03:12:20
问题 i'm using angular2 with meteor. ServiceConfiguration.configurations.insert({ service: "facebook", appId: 'myappID', loginStyle: "redirect", secret: 'mysecret', redirectUrl: 'http://localhost:3000/landing' }); after logging in it always goes back to the home page. (localhost:3000) my router code: export const routes: Route[] = [ { path: '', component: PartiesListComponent }, { path: 'login', component: LoginComponent }, { path: 'profile', component: ProfileComponent }, { path: 'landing',

How to make injected service reactive in Angular2-Meteor

大憨熊 提交于 2020-01-05 03:59:14
问题 I am new to Angular2 and am trying to get a custom Component to use a Service which manages a registry of Mongo.Collection objects. My problem is that I cannot seem to get Angular to refresh the UI when the Collection has loaded. If you take a look at the code below you will see that there is a Component which has a DatasetService injected. This service manages a registry of Collections. I am guessing that the problem is related to the fact that the Meteor.autorun() method takes the

Using Meteor with Angular2/Typescript, how do I call an external web service from server-side code based on a client-side event?

怎甘沉沦 提交于 2019-12-11 14:00:05
问题 When the user adds a new entry in the client, I need to make a web service call from the server (the client-side code will not have access) and add some additional information to the data stored in MongoDB. Trying to use the standard Meteor.methods/Meteor.call pattern does not seem to work. Do I need to listen for the click event on the "Add" button on both the server and the client? Should I raise a custom event on the client that the server reacts to? Is there a proper way to make a direct

Angular2 Meteor Bind Data from calling this.call

这一生的挚爱 提交于 2019-12-11 13:17:07
问题 Methods Meteor.methods({ 'test' : function(test: string) { return test; } }) Component My Class extends MeteorComponent show: string; constructor() { this.call('test', 'txt', (err, res) => { this.show = res }); } view <span>{{show}}</span> it shows nothing, as I expect it will show 'txt'. 回答1: Unlike autorun , call has no parameter to tell it to run inside the NgZone , so Angular's change-detection won't kick in. You'll need to write it this way: constructor(zone: NgZone) { this.call('test',

ng2 update template after making a simple meteor.call

試著忘記壹切 提交于 2019-12-11 02:27:18
问题 This has been asked before but I cannot find an answer that helps. I want oResult to change its value after the call is made. The answer has to be appropriate to running ng2, meteor and angular-meteor. Thanks! /// <reference path="../../typings/angular2-meteor.d.ts" /> import {Input, Component, View, NgZone} from 'angular2/core'; import {MeteorComponent} from 'angular2-meteor'; @Component({ selector: 'testcall', template: ` <button (click)="testCall()">Get TestCall Data</button> <code><pre>{

Uncaught Error: Can't resolve all parameters for NgbAlert with angular2-meteor and ng-bootstrap

╄→尐↘猪︶ㄣ 提交于 2019-12-10 22:35:48
问题 I'm running a meteor project using angular as the front end and I can't seem to figure out how to get @ng-bootstrap/ng-bootstrap to import into my project correctly. Here is my setup... Meteor Version: 1.6, Angular Version: 5.1.3, @ng-bootstrap/bootstrap: 1.0.0-beta.9, Bootstrap: 4.0.0 beta 3 (CSS through CDN) client/app/app.module.ts : (cut down version) import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { AppComponent} from './app-component'; @NgModule({ imports: [OtherModules,

No best common type exists among return expressions

旧时模样 提交于 2019-12-09 17:21:34
问题 When I use Collection2 in angular2-meteor project, these kinds of codes from demo always give me warning in the terminal: No best common type exists among return expressions. How can I improve the codes? Thanks { createdAt: { type: Date, autoValue: function() { if (this.isInsert) { return new Date(); } else if (this.isUpsert) { return {$setOnInsert: new Date()}; } else { this.unset(); } } } } 回答1: Since a type of Date is expected for EVERY return branch, you must return a Date type for every

No best common type exists among return expressions

半世苍凉 提交于 2019-12-04 03:32:20
When I use Collection2 in angular2-meteor project, these kinds of codes from demo always give me warning in the terminal: No best common type exists among return expressions. How can I improve the codes? Thanks { createdAt: { type: Date, autoValue: function() { if (this.isInsert) { return new Date(); } else if (this.isUpsert) { return {$setOnInsert: new Date()}; } else { this.unset(); } } } } Since a type of Date is expected for EVERY return branch, you must return a Date type for every if/else branch OR you can create a union that returns two different types. In either case, you can return

How to Redirect to a certain route based on condition in Angular 2.

▼魔方 西西 提交于 2019-11-30 18:48:07
I am creating one angular2-meteor app. export const routes: Route[] = [{ path: '', redirectTo: "login", pathMatch: "full" }, { path: 'login', component: LoginComponent }, { path: 'csvtemplate', component: TemplateComponent, canActivate: ['canActivateForLoggedIn'], children: [{ path: '', redirectTo: 'dashboard' <----how to add condition for multiple path }, { path:'dashboard', component: DashboardComponent }, { path: 'csvtimeline/:month/:year', component: CsvTimelineComponent }, { path: 'csvjson', component: CsvJsonComponent }] }]; When i login to my app using LoginComponent it will go to

How to Redirect to a certain route based on condition in Angular 2.

谁都会走 提交于 2019-11-30 16:51:44
问题 I am creating one angular2-meteor app. export const routes: Route[] = [{ path: '', redirectTo: "login", pathMatch: "full" }, { path: 'login', component: LoginComponent }, { path: 'csvtemplate', component: TemplateComponent, canActivate: ['canActivateForLoggedIn'], children: [{ path: '', redirectTo: 'dashboard' <----how to add condition for multiple path }, { path:'dashboard', component: DashboardComponent }, { path: 'csvtimeline/:month/:year', component: CsvTimelineComponent }, { path: