angular-meteor

Angularjs and Meteor “Session” reactivity, is there a way?

青春壹個敷衍的年華 提交于 2019-12-04 07:30:38
I'm trying to work with Meteor and Angularjs. I'm using Meteor_angularjs package, which works OK with Collections . Now I'm trying to use Session and my reactive data store: TestCtrl = [ "$scope", function($scope){ $scope.value = Session.get('someValue'); } ] This does not work. QUESTION: Any suggestions on how to tie down Meteor's Session and Angular? As far as I understand, I can write directive that will be polling Session every so ofter, however I don't think that's a good choice. Thanks UPDATE: I've tried the following: TestCtrl = [ "$scope", function($scope){ Meteor.autorun(function(){

Use id from collection insert within a meteor method

ぃ、小莉子 提交于 2019-12-02 06:45:46
问题 Within my Angular / Meteor app I want to use the created id from a collection insert in a meteor method in the client. Within a client Angular component the following method exists. onSubmit(): void { Meteor.call('insertItem', this.item, (error, response) => { if (error) { ... } else { this.ngZone.run(() => { this.router.navigate(['/item/manage', response]); }); } }); } The meteor method that's called by this method looks like following. insertItem(newItem: Item): Observable<string> { return

ng-if being called more times than it should

扶醉桌前 提交于 2019-11-28 01:58:44
I'm trying to filter some channels depending on the selected category. I have an ng-repeat of channel in channels which has an ng-if="hasCategory(channel.category) Here's the document: db.channels.find().pretty() { "_id" : "2kj9GK8jE9yHezoWb", "name" : "example name", "logo" : "path/to/image.svg", "number" : 2, "category" : [ "Broadcast", "Premium" ], "tags" : "example tag tags" } This is the function to handle the ng-if: $scope.hasCategory = function (categoryNameArray) { console.log('thisisbeingcalled'); var e = _.indexOf(categoryNameArray, $scope.activeCategory); if (e === -1) { return

ng-if being called more times than it should

狂风中的少年 提交于 2019-11-26 22:04:28
问题 I'm trying to filter some channels depending on the selected category. I have an ng-repeat of channel in channels which has an ng-if="hasCategory(channel.category) Here's the document: db.channels.find().pretty() { "_id" : "2kj9GK8jE9yHezoWb", "name" : "example name", "logo" : "path/to/image.svg", "number" : 2, "category" : [ "Broadcast", "Premium" ], "tags" : "example tag tags" } This is the function to handle the ng-if: $scope.hasCategory = function (categoryNameArray) { console.log(