Mean.js - angular is not defined - angularjs

I'm just trying to run mean.js using grunt. Just did the installation steps in http://meanjs.org. But when loaded in localhost, console is showing error
Uncaught ReferenceError: angular is not defined
Can any one help how to resolve this problem?

It sounds like angular is not included on the page.
When the install process is over, npm will initiate a bower install command to install all the front-end modules needed (including angular) for the application
You can run bower manually using
bower install --config.interactive=false
make sure that angular appears in the public/lib folder and included on the page.

Related

Load new backand angular sdk from npm

I am currently using the angularbknd-sdk in my Ionic 1 mobile app.
I installed it with Bower, I loaded it as a npm module thanks to browserify-shym:
package.json
"backand": "./bower_components/angularbknd-sdk/dist/backand.min.js"
then I injected the 'backand' module as a dependency of my app :
app.js
require('backand');
angular.module('myApp', ['backand'])
This works like a charm.
But now I would like to use the new Backand angular-sdk, and load it from NPM instead of Bower.
This is what I did :
I removed angularbknd-sdk from bower, from my package.json and the require('backand') line from my app.js.
Then,
I did :
$ npm i -S #backand/angular1-sdk
and I put this line in my app.js :
require('#backand/angular1-sdk');
But when I run my app, I got this error in the javascript console :
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.3/$injector/modulerr?p0=app&p1=Error%3A%20%…%2Fandroid_asset%2Fwww%2Flib%2Fionic%2Fjs%2Fionic.bundle.min.js%3A54%3A463)
What am I doing wrong ?
Thanks in advance.
Without more detail on the exact line that is failing it is hard to tell exactly what is not functioning properly, but this looks like it is missing an ionic include. I would check to make sure you have no occurrences of the Ionic JavaScript SDK in your vendor folder, and that the existing SDK has no files remaining in your project - it is possible that there is an include conflict if the physical javascript files for the old angular1bknd-sdk were not removed from the vendor folder managed by bower.

Using angular from both atmosphere and npm gives warning

Using Meteor 1.3.2.4 I do:
meteor create myapp
cd myapp
meteor npm install --save angular
meteor add angularjs:angular
and in main.js add as first line
import angular from 'angular';
This gives me
WARNING: Tried to load angular more than once.
in the browser console.
I guess this is because angular packages from both npm and atmosphere are added, but I do not know how to circumvent this if I need an atmosphere package that depends on angularjs:angular and also want to to use angular from npm (for example when using angular-meteor). More specifically I want to use the package angular-leaflet-directive in a meteor/angular app. Any suggestions ?
I asked the same question here.
The package author needs to follow those instructions here to make his package work on both Meteor 1.3 and Meteor 1.2 and earlier.
Maybe you could submit a pull request for him and until he will merge it, you could publish to Atmosphere under your own user.
Also, you could just bring angular-leaflet-directive from npm!

Angularjs not rendering

I downloaded a sample Angular app from
https://github.com/angular/material-start
When I open the index file I just get raw Angular syntax and the pages are not showing correctly.
How can I fix this?
You need to run bower to get your dependencies. Just downloading the repo is not enough.
http://bower.io/
Install bower, the in your repo run a bower init
You should see it grab Angular and other items needed.
You need to do the following command in the root directory of your git clone:
npm install
This does a bower install also. You need npm installed (packaged with nodejs)

meanjs - angular is not defined

I'm just learning mean.js . Just did the installation steps in http://meanjs.org .
But when loaded in browser, console is showing error Uncaught ReferenceError: angular is not defined . do we need to include angularjs separately ?
Use this command
bower install --allow-root
No, you dont need to add angularjs one more time because angularjs is added as default in meanjs project.
You may try:
npm install
This command will install node packages and bower packages.
And then run project again:
npm start
Check running meanjs at http://localhost:3000
Hopefully you have a nice time with meanjs.

How do I reference angular-latest installed by bower?

I have installed AngularJS using bower, by calling:
$ bower install angular-latest
Now I wonder how to integrate AngularJS into my html file. Apparently, there is neither an angular[.min].js file nor an index.js file as suggested by the bower documentation.
I can't imagine that I am the first person on earth to discover this problem, but unfortunately I did not find any clues on this on Google (but perhaps I only used the wrong terms for searching).
Any idea of how to include AngularJS?
Okay, I found the solution:
$ bower install angular
And everything is fine ...
What you installed with
$ bower install angular-latest
was only the latest source code. You need to actually build AngularJS.
First, you need to install all of the following dependencies if you haven't already:
Git
Node.js
Java
Grunt
Bower
Second, change into the angular.js directory.
Then, install node.js dependencies and bower components:
$ npm install
$ bower install
Finally, you're ready to build your package:
$ grunt package
In the resulting build directory, you'll find
angular.js — The non-minified angular script
angular.min.js — The minified angular script

Resources