Let me introduce to you what AngularJS is?
AngularJS is a structural framework designed for dynamic WEB applications. It allows you to use HTML as a template language, and by extending HTML syntax, you can build your application components more clearly and concisely. Its innovation is that it uses data binding and dependency injection to prevent you from writing a lot of code. All of these are implemented through browser-side Javascript, which also makes it perfectly combined with any server-side technology.
AngularJS is designed to overcome the shortcomings of HTML in building applications. HTML is a good declarative language designed for static text display, but it will be weak if you want to build WEB applications. So I did some work (you might think it was a little trick) to get the browser to do what I want.
AngularJS provides filters to format input and output data. Let's start introducing the use of Angularjs filters. Let's take a look
• Use in html files and in js files
$scope.form_time = $filter('date')($scope.time, 'yyyy-MM-dd HH:mm:ss');<p>{{time | date: 'yyyy-MM-dd HH:mm:ss'}}</p>•Internal filters and custom filters
.filter('my_data_format',[function(){return function(data,str,ss){console.log('data: ',data,' str: ',str,' sss: ',arguments[2]);}}]);//var1 is the first parameter data, 123 is the second parameter str, this is the third parameter <p>{{var1 | my_data_format: 123 : 'this'}}</p>//process the incoming data.filter('my_data_format',[function(){return function(data,str){var arr=[];angular.forEach(data, function(one_list){if(one_list.status == str){arr.push(one_list);}});return arr;}}]);//Filters can be used in bound values, or in ng-if="(lists | my_data_format: '2').length>0", and ng-show, etc.; similar expressions. As a judgment statement <p ng-repeat = "list in lists">Name:{{list.name}}, number of people{{(lists | my_data_format: '2').length}}</p>