programmer group

Ionic1 uses the ImagePicker plug-in and displays Chinese (Chinese)

When developing with ionic, opening an album should be one of the most frequently used plug-ins.Next, I will talk about my use in the project (this part of the official more detailed, on a brief description) and solve the problem of plug-in display in English. 1. Image picker installationcordova plugin add cordova-plugin-image-picker 2. Use in ionic 1 development2.1 In the JS file angular.module("app").controller("imagePickerCtrl", ["$scope", "$cordovaImagePicker", function ($scope, $cordovaImagePicker,) { "use strict"; ...

programmer group

Ionic1 uses imagepicker to flip back on Android phones

In the previous article, I mentioned how to use the imagepicker plug-in in ionic1 and how to display Chinese in the plug-in.Interested to see: ionic1 uses the ImagePicker plug-in and displays Chinese (Chinese) 1. The problem to be solved this time is that when app opens an album on some mobile phones, it flies back inexplicably.In the previous article, we used the imagepicker plug-in like this. After debugging by connecting to the mobile phone, you can check the relevant error causes. $scope.openImagePicker= () => { const...

programmer group

Ionic uses CardIO to scan bank cards (only under 16 bits, and relief numbers)

In some apps involving payment function, it is usually necessary to bind bank cards. In addition to the manual input of bank card number by users, scanning bank cards by mobile phone is a common means. After consulting and writing information, it is found that ionic has CardIO plug-in to achieve this function, and it is tempting to rush to try, with some disappointment.Here’s how to use CardIO to scan bank cards in ionicNgCordova instructions for CardIO plug-ins 1. In the entry file main.js const app = angular.module("app",...

programmer group

Ionic listens for Android return keys (to implement the "press again to exit" function)

Apps on the Android platform often encounter the function of “pressing once more to exit app” when they are on the main page, so as to avoid quitting app promotion experience optimization just by pressing the return key. 1. This function requires us to use the registerBackButtonAction method provided by ionic (registration hardware back button action) registerBackButtonAction(callback, priority, [actionId]) Description of parameter type Callback function triggers when the return button is clicked, if the monitor has the...

programmer group

Ionic implements downloading files and opening functions (file-transfer and file-opener2 plug-ins)

As an app, downloading the file function and opening the file function are still very necessary in some scenarios. Using cordova-plugin-file-transfer and cordova-plugin-file-opener2 plug-ins, this function can be easily implemented in ionic. 1. Installation: cordova plugin add cordova-plugin-file-transfer cordova plugin add cordova-plugin-file-opener2 2. Code Implementation angular.module("app").controller("accessoryDetailCtrl", ["$scope","$ionicLoading", function ($scope $ionicLoading) { "use strict"; $scope.downLoadFile...

programmer group

Synchronization of Angular 1 Learning Notes, View Model

It started with a minor problem encountered in the project: the project needed an input box to enter the quantity of products sold and calculate the handling fee based on the input data after the user entered it. Naturally, I use ng-model and ng-change, and generally it’s okay. The problem is that there is another button under the input box that sells all. Clicking on this button will automatically set the amount of sales. But in fact, the procedure did not calculate the handling fee at this time.After checking and consulting the...

programmer group

Angular JS Style Guide (ES2015)

# Angular JS Style Guide (ES2015) Best practices for Angular Js 1.6.x. Cover architecture, file structure, components, one-way data flow and lifecycle. Catalog Modular Architecture Summary Root module Component module Common module Low-level modules File naming conventions Scalable file structure assembly Summary Supported properties Controller Single Data Flow and Events Stateful Component/Container Component Stateless Component/Display Component Routing component instructions Summary Recommended attributes Constants or...

programmer group

Angular JS Notes

Angular JS Notes Angular JS has been used for more than a year, during which many problems have been encountered, but they have not been recorded, so that many times have to repeatedly look for the same information, so now I intend to accumulate records from now on. FromJson and toJson methods angular.fromJson()The method is to convert JSON into an object or an array of objects. The source code is as follows: function fromJson(json) { return isString(json) ? JSON.parse(json) : json } angular.toJson()The method is to...

viblo.asia

Angularjs 8 tutorial Part 1: The Application Shell

Trong phần này chúng ta sẽ tìm hiểu cách xây dứng ứng dụng Angularjs8 cơ cơ bản. Chúng ta tạo một ứng dụng ban đầu bằng cách sử dụng Angular CLI. Trong suốt hướng dẫn này, bạn sẽ cập nhật và mở rộng ứng dụng khởi động đó để tạo ứng dụng tên là Tour of Heroes. Trong phần hướng dẫn này: 1. Cài đặt môi trường của bạn. 2. Tạo một không gian làm việc mới và khởi tạo dự án ban đầu. 3. Phục vụ ứng dụng. 4. Thay đổi...

viblo.asia

Angularjs8 tutorial Part 1:Introduction - Create app using Angular CLI.

Trong phần này chúng ta sẽ tìm hiểu cách xây dứng ứng dụng Angularjs8 cơ cơ bản. Introduction Angularjs là một bộ Javascript Framework rất mạnh và thường được sử dụng để xây dựng project Single Page Application (SPA). Nó hoạt động dựa trên các thuộc tính mở rộng HTML (các atributes theo quy tắc của Angular). Đây là một Framework mã nguồn mở hoàn toàn miễn phí và được hàng ngàn các lập trình viên trên thế giới ưa chuộng và sử...

programmer group

Monitor Angular Startup Process

Links to the original text:Hooking into the Angular bootstrap process Angular provides some mechanisms to monitor the framework initialization process. This article mainly explores how to use these mechanisms. APP_BOOTSTRAP_LISTENER ForAPP_BOOTSTRAP_LISTENERThe token registration listener monitors the Angular startup process, such as looking atAngular source codeHow is it used? private _loadComponent(componentRef: ComponentRef<any>): void { this.attachView(componentRef.hostView); this.tick(); ...

programmer group

Mock server scheme for front-end and back-end separation (1) - Moco

Although front-end and back-end separation has been popular for many years, there are still many teams that can not make full use of the advantages of front-end and back-end separation.Mainly reflected in the front-end over-reliance on the service environment, the efficient contract division of labor and cooperation mode understanding is very shallow. A mock server solution is recommended here. There are many schemes for mock server: 1. Java API 2. JUnit @Rule 3. Node.js (npm) module 4. Grunt plugin 5. Docker...

programmer group

Old Tree Sprouting - Use mobx to speed up your Angular JS application

Old Tree Sprouting – Use mobx to speed up your Angular JS application Original: https://github.com/kuitos/kui… At the end of January, Angular’s official blog published a message: AngularJS is planning one more significant release, version 1.7, and on July 1, 2018 it will enter a 3 year Long Term Support period. That is, after the release of Angular JS version 1.7.0 on July 1, Angular JS will enter a three-year LTS period. That is to say, from July 1, 2018 to June 30, 2021, Angular JS will not merge any features or...