Home > Web Front-end > JS Tutorial > body text

Angular gets the json file defined in the project

一个新手
Release: 2017-10-17 09:42:19
Original
1511 people have browsed it

Project structure:

The folder js is located in the root path


1 $http.get('js/app/contact/contacts.json').then(function (res) {
2     /*下面就是获取到的数据*/
3     $scope.contactsData = res.data;
4   });
Copy after login

The request address starts from the root path to the requested file

The above is the detailed content of Angular gets the json file defined in the project. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!