


Address book based on Amap location developed by AngularJS Node.js MongoDB_node.js
1. Chatting
One day the monitor said that the students wanted me to develop an address book that could share locations, so I simply designed the function myself. Including user roles, posting Weibo, sharing location, etc. This time it was also a bit selfish. In order to practice the angularjs I had recently watched, I decisively chose the Node.js MongoDB angular.js solution. Of course, my experience in developing Node.js is getting deeper and deeper. I remember, last year my leader told me to try to make each node service only support one business function, so that it can be more convenient to maintain. At that time, I particularly wanted to make a Node service particularly powerful. Now it seems that leader’s approach is right. I am more inclined to simplify the node service function...
2. Go directly to the dry goods
The database service is deployed on Alibaba Cloud; the static file server uses Github page.
Github project address: https://github.com/vczero/OurTimes
Online experience address: http://vczero.github.io/tuban/main.html#/
I don’t have a picture to talk about a ball. I’ll show you 2 screenshots above:
(1)Homepage
(2) Address Book
....More experience online...
3. Project
Total project: https://github.com/vczero/OurTimes
Developed the required services: https://github.com/vczero/OurTimes/tree/master/server
Opened web pc client: https://github.com/vczero/OurTimes/tree/master/client-web
Developed a simple backend management system: https://github.com/vczero/OurTimes/tree/master/client-admin
Welcome to fork, follow and share the code, and work together to build the front end.
4. Attached is the entry file code for Angular on the web-pc side
var app = angular.module('app', ['ui.router', 'ngCookies']);
var SERVER_BASE_URL = 'http://127.0.0.1:3000/';
//Initialization configuration
app.run(['$rootScope', function($rootScope) {
$rootScope.appName = 'Tuban.com';
$rootScope.desc = 'Location-based address book';
$rootScope.author = 'Ghost Ballad';
$rootScope._email = 'wlhmyit@126.com';
}]);
//调用的服务列表
app.constant('ServiceConfig', {
wei_content: SERVER_BASE_URL 'wei/get',
wei_zan: SERVER_BASE_URL 'wei/zan',
wei_comment: SERVER_BASE_URL 'wei/comment',
wei_create: SERVER_BASE_URL 'wei/create',
user_get: SERVER_BASE_URL 'user/get',
user_login: SERVER_BASE_URL 'user/login',
user_register: SERVER_BASE_URL 'user/register',
user_common: SERVER_BASE_URL 'user/getCommon',
user_ben: SERVER_BASE_URL 'user/getBen',
user_self: SERVER_BASE_URL 'user/getSelf',
user_common_update: SERVER_BASE_URL 'user/updateCommon',
user_ben_update: SERVER_BASE_URL 'user/updateBen',
user_ben_get_name: SERVER_BASE_URL 'user/singleBen/name',
user_common_get_nickname: SERVER_BASE_URL 'user/getCommon/name',
user_ben_get_realname: SERVER_BASE_URL 'user/singleBen/name',
wei_get_token_page: SERVER_BASE_URL 'wei/getByToken',
wei_delete: SERVER_BASE_URL 'wei/delete',
user_update_password: SERVER_BASE_URL 'user/updatePassword',
article_get: SERVER_BASE_URL 'article/get',
article_detail: SERVER_BASE_URL 'article/get/id',
amap_url: 'http://webapi.amap.com/maps?v=1.3&key=ad925c5003760094713775d64748d872&callback=init'
});
//JSON parse
app.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
$httpProvider.defaults.headers.put['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
$httpProvider.defaults.transformRequest = [function(data) {
var obj = [];
for (var key in data) {
obj.push(key '=' data[key]);
}
return obj.join('&');
}];
}]);
//路由配置
app.config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {
/*URL路由*/
$urlRouterProvider.otherwise("/");
/*状态配置*/
$stateProvider
//首页
.state('index', {
url: '/',
views: {
'': {
templateUrl: 'views/index/index.html',
},
'header@index': {
templateUrl: 'views/header.html',
controller: 'HeaderController'
},
'footer@index': {
templateUrl: 'views/footer.html',
controller: ''
},
'weibo@index': {
templateUrl: 'views/index/weibo.html',
controller: 'WeiboController'
},
'article@index': {
templateUrl: 'views/index/article.html',
controller: 'ArticleController'
},
'post@index': {
templateUrl: 'views/index/post.html',
controller: 'PostWeiboController'
}
}
})
.state('login', {
url: '/login',
views: {
'': {
templateUrl: 'views/login/login.html',
controller: 'LoginController'
}
}
})
.state('register', {
url: '/register',
views: {
'': {
templateUrl: 'views/register/register.html',
controller: 'RegisterController'
}
}
})
.state('contacts', {
url: '/contacts',
views: {
'': {
templateUrl: 'views/contacts/contacts.html',
controller: ''
},
'header@contacts': {
templateUrl: 'views/header.html',
controller: 'HeaderController'
},
'userinfo@contacts': {
templateUrl: 'views/contacts/userinfo.html',
controller: 'UserInfoController'
},
'map@contacts': {
templateUrl: 'views/contacts/map.html',
controller: 'MapController'
},
'search@contacts': {
templateUrl: 'views/contacts/search.html',
controller: 'SearchUserController'
}
}
})
.state('ucenter', {
url: '/ucenter',
views: {
'': {
templateUrl: 'views/ucenter/ucenter.html',
controller: ''
},
'header@ucenter': {
templateUrl: 'views/header.html',
controller: 'HeaderController'
},
'userWeibo@ucenter': {
templateUrl: 'views/ucenter/weibo.html',
controller: 'UcWeiboController'
},
'userDetailInfo@ucenter': {
templateUrl: 'views/ucenter/user.html',
controller: 'UcUserController'
},
'footer@ucenter': {
templateUrl: 'views/footer.html',
controller: ''
}
}
})
.state('article', {
url: '/article/:id',
views: {
'': {
templateUrl: 'views/article/article.html',
controller: ''
},
'header@article': {
templateUrl: 'views/header.html',
controller: 'HeaderController'
},
'article_content@article': {
templateUrl: 'views/article/article_content.html',
controller: 'ArticleDetailController'
},
'footer@article': {
templateUrl: 'views/footer.html',
controller: ''
}
}
})
.state('article_index', {
url: '/article',
views: {
'': {
templateUrl: 'views/article/article.html',
controller: ''
},
'header@article_index': {
templateUrl: 'views/header.html',
controller: 'HeaderController'
},
'article_content@article_index': {
templateUrl: 'views/article/article_content.html',
controller: 'ArticleDetailController'
},
'footer@article_index': {
templateUrl: 'views/footer.html',
controller: ''
}
}
});
}]);

The main difference between Python and JavaScript is the type system and application scenarios. 1. Python uses dynamic types, suitable for scientific computing and data analysis. 2. JavaScript adopts weak types and is widely used in front-end and full-stack development. The two have their own advantages in asynchronous programming and performance optimization, and should be decided according to project requirements when choosing.

Whether to choose Python or JavaScript depends on the project type: 1) Choose Python for data science and automation tasks; 2) Choose JavaScript for front-end and full-stack development. Python is favored for its powerful library in data processing and automation, while JavaScript is indispensable for its advantages in web interaction and full-stack development.

Python and JavaScript each have their own advantages, and the choice depends on project needs and personal preferences. 1. Python is easy to learn, with concise syntax, suitable for data science and back-end development, but has a slow execution speed. 2. JavaScript is everywhere in front-end development and has strong asynchronous programming capabilities. Node.js makes it suitable for full-stack development, but the syntax may be complex and error-prone.

JavaScriptisnotbuiltonCorC ;it'saninterpretedlanguagethatrunsonenginesoftenwritteninC .1)JavaScriptwasdesignedasalightweight,interpretedlanguageforwebbrowsers.2)EnginesevolvedfromsimpleinterpreterstoJITcompilers,typicallyinC ,improvingperformance.

JavaScript can be used for front-end and back-end development. The front-end enhances the user experience through DOM operations, and the back-end handles server tasks through Node.js. 1. Front-end example: Change the content of the web page text. 2. Backend example: Create a Node.js server.

Choosing Python or JavaScript should be based on career development, learning curve and ecosystem: 1) Career development: Python is suitable for data science and back-end development, while JavaScript is suitable for front-end and full-stack development. 2) Learning curve: Python syntax is concise and suitable for beginners; JavaScript syntax is flexible. 3) Ecosystem: Python has rich scientific computing libraries, and JavaScript has a powerful front-end framework.

The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)
