These are chat archives for Urigo/angular-meteor

12th
Apr 2016
janibekm
@janibekm
Apr 12 2016 02:19
hi guys! i have updated my ng2 project. and now working fine but terminal have lot of warning for example "Module ''angular2/router'' resolves to a non-module entity and cannot be imported using this construct."
pacozaa
@pacozaa
Apr 12 2016 04:51
@Hongbo-Miao Thank you.
Miloš Stanić
@MilosStanic
Apr 12 2016 08:07
@janibekm yes, I have lot of warnings in terminal about being unable to import all sorts of things because they are not modules. But you can ignore those warnings. Everything works normally.
David Bonachera
@davidbonachera
Apr 12 2016 09:12
Hi, do someone know the procedure to use Collection2 on angular2 ?
since i’m using meteor add i can’t use it in my collections/myCollection.ts
Miloš Stanić
@MilosStanic
Apr 12 2016 12:11
@davidbonachera yes you can, should be, just do import {SimpleSchema} from 'meteor/aldeed:collection2' and then you should be able to use it
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 18:46
This message was deleted
I tried to use Match.ObjectIncluding
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
these two work well
only import { Match } from 'meteor/match’; does not work
I got error Error: Can't find npm module 'meteor/match'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
have you used that and succeed @MilosStanic
Miloš Stanić
@MilosStanic
Apr 12 2016 18:52
@Hongbo-Miao I just read about it, not actually used it :)
it's in the meteor 1.3 guide
actually for me, I still get errors on import {Meteor} from 'meteor/meteor'; but it actually works
like this: server/main.ts (1, 24): Cannot find module 'meteor/meteor'.
same error importing from meteor/mongo
oh, wait, I actually successfuly use import from meteor/tmeasday:publish-counts, but also get warning in server console about not being able to find the module
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 18:55
that is weird, I didn’t get that error
but I got warning If you notice problems related to these missing modules, consider running: meteor npm install --save !!.
and I have no idea what this is, the app still runs perfect
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:02
@MilosStanic you can try to follow the new tutorial again, from Step 1 to 17, I have fixed all errors I found. The tutorial from Step 1 to 17 should work now.
Miloš Stanić
@MilosStanic
Apr 12 2016 19:03
@Hongbo-Miao that's great. I don't think I'll find time to do it. But I often use it as reference for recipe's
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:04
I think u missed some step, that is why you got error Cannot find module 'meteor/meteor’.
Miloš Stanić
@MilosStanic
Apr 12 2016 19:06
I really don't think so... I'll check... but the error is stupid, and there should be a way, or somebody who knows how to get rid of it
I even get this message server/main.ts (43, 9): Cannot find name 'console'. when I use console.log :D
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:09
I got your same errors when I updated my project from meteor 1.2 to 1.3 directly before. But now since I created a new clean project, and move my code part by part, the only warning I got is If you notice problems related to these missing modules, consider running: meteor npm install --save !!.
Miloš Stanić
@MilosStanic
Apr 12 2016 19:12
this was a fresh project I started following instructions on angular2-meteor page
never mind, I can live with these messages
Miloš Stanić
@MilosStanic
Apr 12 2016 19:19
@Hongbo-Miao did you investigate options for file upload as replacement for CollectionFS?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:22
not yet
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:44
@MilosStanic oh for that error cannot find module,
Miloš Stanić
@MilosStanic
Apr 12 2016 19:45
where do I put that file?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:45
add to your typings folder
in typings/main.d.ts, add /// <reference path="meteor.d.ts" />
Miloš Stanić
@MilosStanic
Apr 12 2016 19:46
I don't have typings folder, it's not created by default
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:46
Search TypeScript Typings part
Miloš Stanić
@MilosStanic
Apr 12 2016 19:47
thanks
brb
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 19:48
For meteor.d.ts, it is speciall, because it is not published yet
Miloš Stanić
@MilosStanic
Apr 12 2016 20:59
@Hongbo-Miao alright, that resolved almost all the issues, now I only have this left in my console:
client/components/korektor.ts (8, 22): Cannot find module 'meteor/tmeasday:publish-counts'.
Compiling main app HTML file: client/app.html|
server/recnik-slovo-nepars.ts (4, 22): Cannot find module 'meteor/tmeasday:publish-counts'.
server/recnik-slovo-nepars.ts (37, 4): Cannot find name 'console'.
server/routes.ts (2, 22): Cannot find module 'meteor/iron:router'.
server/main.ts (43, 9): Cannot find name 'console'.
server/main.ts (66, 17): Cannot find name 'console'.
server/main.ts (141, 21): Cannot find name 'console'.
server/main.ts (186, 30): Cannot find name 'console'.
server/main.ts (287, 9): Cannot find name 'console'.
=> Started your app.
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:23
nice, not sure, propobally they are also in some d.ts files?
I guess you still missed some steps
jahala
@jahala
Apr 12 2016 21:24
Hi guys.. I'm on the tutorial and everything is fine when I run "meteor" - even without errors, but I'm not getting any content when going to localhost:3000.. Ideas?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:27
@jahala I think you should follow strictly the tutorial again, make sure you don't miss any step. The tutorial should work. I haven’t fixed the wrong places.
jahala
@jahala
Apr 12 2016 21:28
I read your comment earlier about meteor.d.ts
So I fixed that problem early
(in typings)
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:28
when did u follow the tutorial?
because I just fixed wrong places in the tuorial very recently
so you may use an old tuorial
jahala
@jahala
Apr 12 2016 21:30
I tried two days ago and then I couldn't get that error fixed (because I didn't know I had to add /// <reference path="../meteor/meteor.d.ts" /> in main.d.ts) and gave up
And so I tried again now, just 40 minutes ago
And reinstalled everything
(I decided to try again since I saw your comment to Milo further up)
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:31
even not succeed show a Hello World yet?
jahala
@jahala
Apr 12 2016 21:31
nope
Meteor is running fine, I can connect to localhost:3000 and console has the "meteor is running in development mode" comment
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:32
hmm..
i am not sure, but you can post your codes here
jahala
@jahala
Apr 12 2016 21:36
going through the steps again.. does this mean I have the wrong versions?:
$meteor npm install --save angular2-meteor
npm WARN angular2@2.0.0-beta.14 requires a peer of reflect-metadata@0.1.2 but none was installed.
npm WARN angular2-meteor@0.5.2 requires a peer of angular2@2.0.0-beta.12 but none was installed.
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:36
no, you are fine
that is normal warning
jahala
@jahala
Apr 12 2016 21:38
$ meteor npm install --save meteor-node-stubs
npm WARN package.json socially@1.0.0 No description
npm WARN package.json socially@1.0.0 No repository field.
npm WARN package.json socially@1.0.0 No README data
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/Users/Jahala/.meteor/packages/meteor-tool/.1.3.1.nwdv3u++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm" "install" "--save" "meteor-node-stubs"
npm ERR! node v0.10.43
npm ERR! npm  v2.14.22
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package angular2@2.0.0-beta.14 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer angular2-meteor@0.5.2 wants angular2@2.0.0-beta.12`
And this?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:40
did u run npm init?
before any npm command
jahala
@jahala
Apr 12 2016 21:40
I believe I did - should I redo everything to test or can I do an npm init now
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:41
no, go on, i think this warning is still normal
jahala
@jahala
Apr 12 2016 21:43
No luck, I'll delete the folder and try once more
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:45
@jahala u can skip step 0.3 after you did npm init
jahala
@jahala
Apr 12 2016 21:46
after npm init, do I replace the contents of package.json to this:
{
  "name": "meteor-angular2.0-socially",
  "version": "1.0.0",
  "description": "Tutorial is based on building Angular2 UI for a Meteor app called Socially.",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/dotansimha/meteor-angular2.0-socially.git"
  },
  "author": "Dotan Simha &lt;dotansimha@gmail.com&gt; (http://github.com/dotansimha/)",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/dotansimha/meteor-angular2.0-socially/issues"
  },
  "homepage": "https://github.com/dotansimha/meteor-angular2.0-socially#readme"
}
?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:46
@jahala u can skip step 0.3 after you did npm init
yeah
jahala
@jahala
Apr 12 2016 21:50
followed instructions exactly to point 0.10
nothing showing on localhost:3000
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:50
even not add typings, u should see something on screen at this point..
jahala
@jahala
Apr 12 2016 21:50
(It was showing content right after creating socially and running meteor)
Orlando Quero
@orlaqp
Apr 12 2016 21:51
hi guys I am usgin angular-meteor with meteor 1.3 and I am trying to use moment library
jahala
@jahala
Apr 12 2016 21:51
No i didnt even add typings
Orlando Quero
@orlaqp
Apr 12 2016 21:51
I installed it like this:
meteor npm install --save moment
but when i try to import it like this:
import moment from 'moment';
I get the following error:
Meteor server restartedclient/app.ts (6, 20): Cannot find module 'moment'.
any idea why?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:53
@jahala did u add Hello World in client/app.html?
jahala
@jahala
Apr 12 2016 21:53
@Hongbo-Miao Yes
Orlando Quero
@orlaqp
Apr 12 2016 21:53
I am following this guide to import moment: http://guide.meteor.com/using-packages.html#installing-npm
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:57
@jahala I run out of idea.. It should work, because I succeed..
jahala
@jahala
Apr 12 2016 21:58
could it be some kind of global node module that is interfering?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 21:58
@jahala you only have 3 files in client folder, right?
jahala
@jahala
Apr 12 2016 21:58
yes, app.html, app.ts and index.html
I don't understand why its not working - because it was actually working the last time I tried (2 days ago).. but then I had to live with the error messages because of missing meteor.d.ts
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 22:00
@jahala I will try to follow the steps again soon
jahala
@jahala
Apr 12 2016 22:01
Ok.. is there some way of checking in console if angular2 is "working?"
since meteor starts (only without content)
I see in chrome developer view that its loaded a lot of packages related to angular 2..
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 22:12
@orlaqp I will have a look that soon, I met that problem before
jahala
@jahala
Apr 12 2016 22:15
blob
@Hongbo-Miao
Its even loading the app.ts ..
Konstantin
@chuikoffru
Apr 12 2016 22:27

Hi gays! Help me please:

class UsersList {
  constructor($scope, $reactive, $state) {
    'ngInject';
    //...
    this.state = $state;
  }

  select_user(email) {
    Meteor.call('getUserByEmail', email, function (err, result) {
      Session.set('selected_user', result);
      this.state.go('shops'); //that error.
    });
  }
}

Error: Exception in delivering result of invoking 'getUserByEmail': TypeError: Cannot read property 'go' of undefined

OOoppss...Sorry for my English... Guys!!!
Miloš Stanić
@MilosStanic
Apr 12 2016 22:42
@jahala are you sure about templateUrl in your app component? Try ./app.html instead.
jahala
@jahala
Apr 12 2016 22:44
@MilosStanic : tried that now - same result (nothing)
Miloš Stanić
@MilosStanic
Apr 12 2016 22:44
@chuikoffru is that angular1 with typescript or es6 or what is that?
@jahala try replacing templateUrl line with template: '<div>Hello jahala</div>',
jahala
@jahala
Apr 12 2016 22:46
good call, that worked
Miloš Stanić
@MilosStanic
Apr 12 2016 22:46
@jahala, so your templateUrl was wrong, it wasn't finding the app.html where it was looking.
jahala
@jahala
Apr 12 2016 22:47
you wont believe what the problem was
Miloš Stanić
@MilosStanic
Apr 12 2016 22:48
@chuikoffru I know what's your problem. It's the scope of this
jahala
@jahala
Apr 12 2016 22:48
there was a blank space in the filename app.html[space]
Miloš Stanić
@MilosStanic
Apr 12 2016 22:48
so replace your Meteor.call line with this:
Meteor.call('getUserByEmail', email, (err, result) => {
@jahala it's always the stupidest thing that makes you lose hours of time :)
jahala
@jahala
Apr 12 2016 22:49
...2 hours...
:D
Miloš Stanić
@MilosStanic
Apr 12 2016 22:50
you may report that as a bug to the Angular2 team, I think it is supposed to trim whitespaces
Konstantin
@chuikoffru
Apr 12 2016 22:50
@MilosStanic Thanks man! Good work, thanks for fast reply.
jahala
@jahala
Apr 12 2016 22:51
even in the actual filenames? not the declaring of file name?
Miloš Stanić
@MilosStanic
Apr 12 2016 22:51
@chuikoffru glad to help... I lost some time too, until I figured that little thing out :)
well, whitespaces should be no part of filenames, so it should at least report an error, if not trim it automatically
jahala
@jahala
Apr 12 2016 22:52
I guess at least it should not begin or end with a whitespace
Miloš Stanić
@MilosStanic
Apr 12 2016 22:52
@jahala wait, what did you just say... did the actual filename have whitespace in the end? That's impossible
jahala
@jahala
Apr 12 2016 22:53
Not on a mac it seems :D when creating the file from sublime text
Miloš Stanić
@MilosStanic
Apr 12 2016 22:53
hm :) strange
I thought you put whitespace in templateUrl declaration
jahala
@jahala
Apr 12 2016 22:54
no that would have been a simple fix- I think I redid everything 3-4 times
Miloš Stanić
@MilosStanic
Apr 12 2016 22:55
haha :) okay, be more careful next time
jahala
@jahala
Apr 12 2016 22:55
lol
I tested now with whitespace in the templateUrl declaration
same error!!
I just add it as an issue in angular/angular on github?
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 23:20
@jahala did u do meteor npm install --save angular2-meteor and also meteor npm install --save meteor-node-stubs
I just succedd again
jahala
@jahala
Apr 12 2016 23:20
@Hongbo-Miao the error was a whitespace in the actual filename
app.html[whitespace]
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 23:21
so u fixed it?
jahala
@jahala
Apr 12 2016 23:21
Yes - And also, adding a whitespace in templateUrl: 'file.html ', <-- whitespace at end creates the same error
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 23:21
ok cool
jahala
@jahala
Apr 12 2016 23:21
But with only angular2 you get an error in console from that
But that error was not passed on by meteor when it built the "package" or what to call it
Hongbo Miao
@Hongbo-Miao
Apr 12 2016 23:22
@orlaqp did u run typings install moment?
jahala
@jahala
Apr 12 2016 23:23
So it was not indicating any errors in building or when serving the page... which I think is very strange.. Are the errors from angular2 not passed on to the client via angular-meteor?