Tips and Tricks in a world of Mix

Posts tagged ‘angularjs’

Mean Stack – message board with authentication demo with Angular2

Heroku Demo online

msgBoard.png

Download Demo at – Github repository with explanations in Readme

angular2_nodejs_connection

Seeder of all levels to work with Node.js Express with MongoDb and Angular2 – each branch different stage. Connecting Angularjs with nodejs

Demo Heroku Deployed

Demo AWS Deployed

Both use mlab.com as a source for MongoDB database

Node.js

Download node.js https://nodejs.org/en/download/ Now we can use npm – node package manager –http://blog.npmjs.org/post/85484771375/how-to-install-npm

First Command Line run to run node.js server

npm run build  

Second Command Line to run the angular client ( views of node for now)

npm start

MongoDB

Download MongoDB https://www.mongodb.com/download-center?jmp=nav#community And install

To use MongoDB after installation add packages

    Ø npm install --save mongoose
    Ø npm install mongoose-unique-validator   (--this one is for unique fields)

For running MongoDB server for me it worked specificly with –dbpath “e:\data\db” only

cd E:\MongoDB\Server\3.2\bin
E:\MongoDB\Server\3.2\bin>mongod.exe --dbpath "e:\data\db"

More there – Github repository with explanations in Readme

 

 

P.S.

The project based on this course

https://www.udemy.com/angular-2-and-nodejs-the-practical-guide

 

Get scope from element

// Access whole scope
angular.element(myDomElement).scope();

// Access and change variable in scope
angular.element(myDomElement).scope().myVar = 5;
angular.element(myDomElement).scope().myArray.push(newItem);

// Update page to reflect changed variables
angular.element(myDomElement).scope().$apply();

Or if you’re using jQuery, this does the same thing…

$('#elementId').scope();
$('#elementId').scope().$apply();

Another easy way to access a DOM element from the console (as jm mentioned) is to click on it in the ‘elements’ tab, and it automatically gets stored as $0.

angular.element($0).scope();

Tag Cloud

%d bloggers like this: