Closed 6gsaifulislam closed 9 years ago
Can you share your code? i'll have a look...
Here is a link to zip file on my OneDrive:
You just need to use the 0.9.0 alpha version of urigo:angular and everything will work :) change the version in your versions file to 0.9.0-alpha.5.
Thanks very much - it worked a treat!
Sorry to be a pain in the neck: could you check that version 0.9.0-alpha.5 is ok with ng material - I have been trying to get my version to work and have found that the problem occurs when ng material is injected into lib/app.js
Sorry I am wrong the problem is I cannot add any packages i.e. ui.router not working either!
Since lib/app.js is shared in server and client code, loading client libraries on the server is not going to work. Change your app.js like so:
var deps = ['angular-meteor'];
if (Meteor.isClient) {
deps.push('ng-material');
}
else {
deps.push(......);
}
var app = angular.module('myApp', deps);
should make it work...
Thanks very much - I was going round in circles putting lib/app in the main folder or in the client folder and beginning to wonder which was right.
Looking at the example code provided var deps = ['angular-meteor']; ... does that mean the angular server side can have libraries loaded, and how is debugging going to work on the server? Angular can be very tricky to get right - is there the ability to debug in run mode?
Yeah you can debug the server side just like any meteor app. Here a SO question with explanations: http://stackoverflow.com/questions/11034941/meteor-debug-on-server-side
Many thanks it looks good, I hope I don't have to do much debugging
I am have trouble with using angular-server so I tried using the example version - but I am running into the following problem:
Error: [$injector:unpr] Unknown provider: DataProvider <- Data <- MainController
So basically the client is not getting the api service defined in ServerAPIProvider.register('Data');
Steps taken: 1: created new meteor folder. 2 added packages urigo:angular and etanelgilad:angular-server 3 removed default js html and css files. 4 Copied the folders client, lib, model and server from angular-server-example github.
So basically the Angular client does not know about the Data and TodosManager services