This article mainly introduces 3 ANGULARJS instructions that can improve the user experience, Angularjs is a highly popular JavaScript framework, the need for friends can refer to the
1. Avatar Picture
To display avatar images in your application,
Introduced
When it comes to the development of computer software, I want to use all the latest technology. For example, the front-end uses the latest JavaScript technology, and the server side uses the latest REST-based Web API service. In addition,
One day the monitor said, the students want me to develop a can share the address book, so I simply designed the next function. Including user roles, publishing microblogging, sharing location, and so on. This is also a bit selfish, in order to
I think everyone should have contacted the file management system, whether it's a file manager in Windows or a browser-based Web File Manager, with similar functionality. Although the file manager seems simple, but the real implementation is still a
ANGULARJS Development Mobile End page, make mobile end page must be inseparable from, Touchstart, Touchmove, touchend these actions, but Angularjs provided Ng-touch module is not ngtouchstart this touch screen event , so that the click Delay, so
The default question mark always appears in the dropdown box today:
After Google's constant viewing of the data, it was found that Ng-model was not assigned and must be an object. property;
Wrong code:
$scope. localeoptions = [{ID: "ZH_CN",Name:
App.factory ("FileReader", Function ($q, $log) { var onLoad = function (reader, deferred, scope) {return function () {Scope. $apply (function () {Deferred.resolve (Reader.result);});};}; var onError = function (reader, deferred, scope) {return
function Imgfile (file) {
var reader = new FileReader ();
$scope. Guid = (new Date ()). valueof (); Creates a random number with a timestamp, using the
reader.onload = function (ev) {
$scope. $apply (function () {
Angularjs to avoid polluting the global space using skills
1. Avoid using $scope
Because after using $scope, variables are in the global space, in a large project many people collaboration may appear naming overlap, then there will be unexpected
settings for simple global variables
1, the direct definition of global variable through VAR, this pure JS is the same.2, use ANGULARJS value to set the global variable.3, use ANGULARJS constant to set global variables.
The example code is as
In the project, a problem has been encountered, in the ng-repeat in angular, the order by is invalid when track by and by are in use. Let's take a look at how Ng-repeat works. Here is a demo: 1. Original state Index.html
insert Title here
Angularjs First vehicle: ANGULARJS Introduction and the first instance Angularjs Introduction characteristics Introduction Terminology explanation grammar
Example explanation
Absrtact: Mainly introduces the Angularjs and its characteristic, and
Self-execution function (Iife), providing a separate scope for each file
/* Avoid
///logger.js
angular
. Module (' app ')
. Factory (' logger ', logger);
The logger function is treated as a global variable
function logger ()
Because Angularjs infers the dependent service name through the parameter name of the controller constructor. So if you want to compress the controller's JS code, all of its parameters will also be compressed, then rely on the injection system can
Encountered a problem, set the Stafftype default value in the controller
. Controller (' Infostaffctrl ', function ($scope, $rootScope, $state, $log, $ionicLoading, $timeout, Manpower) {
//List
$scope. Search = {p:1,audittype: ',
If you enter the Market/beian/add add data, save the submission back to the Market/beian list page, do not automatically update the data, you must manually drop the refresh will come out
$state. Go ("Marketbeian", {},{reload:true});
After
Phenomenon:1. Angular HTTP does not configure data (request parameters) without error2. After adding the request parameter, the error3. Server Response.headers (). Set (HttpHeaders.Names.ACCESS_CONTROL_ALLOW_HEADERS,
"Front-end mystery Veil"For backend development, the front end is mysterious,Dazzling technology, a multitude of frames,If you still stay on the front end equals just use jquery for development, then you're out,This article from the Java perspective
This article transferred from: Http://www.tuicool.com/articles/zeymimBWith the increase in web traffic around the world, we are also constantly internationalizing and localizing applications as developers. When a user accesses our app, he should be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.