angularjs

前端工程师必知:2016 年崛起的 JS 项目

我怕爱的太早我们不能终老 提交于 2020-12-18 07:32:56
近几年 JS 社区创新和演化的速度是有目共睹的,几个月前比较时髦的技术很可能现在已经过时了。2016 已经过去,你有没有担心错过了什么重要的内容?在这篇调查报告中我们会为你解读社区的主流趋势。 我们将从数量上来分析哪些项目 2016 年获得比较多的关注,具体的做法是比较各项目 2016 年在 Github 上新增 star 的数量。 回顾 2015 年:React 无疑占据了统治地位,而 Redux 则在众多牛毛的 Flux 实现中脱颖而出。那么 2016 年哪些项目最受开发者关注呢? 目录 最受欢迎项目 前端框架 Node.js 框架 React 项目模板 移动开发 编译工具 构建工具 测试框架 IDE 静态网站生成器 1. 最受欢迎项目 仔细观察 2016 年排名前 10 的项目,你就能对 WEB 社区的演化方向有个直观的把握,概括如下: 3 个 UI 框架:Vue.JS, React and Angular 2 1 个新的 Node.js 包管理器:Yarn 创建桌面应用的首选:Electron 创建 react 新项目的首选:Create React App 1 个移动开发框架:React Native 最受欢迎的 CSS 工具箱:Bootstrap 函数式编程风格的状态管理库:Redux 强大兼具灵活的绘图库:D3 上面这些项目覆盖的领域,无疑证明了 JS 的通用性

Content-Type四种常见取值

怎甘沉沦 提交于 2020-12-17 21:41:35
一、application/x-www-form-urlencoded 最常见 POST 提交数据的方式。浏览器的原生 form 表单,如果不设置 enctype 属性,那么最终就会以 application/x-www-form-urlencoded 方式提交数据。请求类似于下面这样: POST http: // 192.168.2.12/index HTTP/1.1 Content-Type: application/x-www-form-urlencoded;charset=utf- 8 title =test&sub%5B%5D= 1 &sub%5B%5D= 2 &sub%5B%5D= 3 首先,Cntent-Type 被指定为application/x-www-form-urlencoded。其次,提交的数据按照 key1=val1&key2=val2 的方式进行编码,key 和 val 都进行了 URL 转码。大部分服务端语言都对这种方式有很好的支持。 二、 multipart/form-data 这是另一种非常常见的 POST 数据提交的方式。我们在使用表单上传文件时,必须让 form 的 enctyped 等于这个值。关于处理上传请求的实战后续我会写文章来补充。来看一个请求示例: POST http: // 192.168.2.12/index HTTP/1.1

angular2 ng-if

孤街浪徒 提交于 2020-12-17 01:06:01
ng-if <td ><div class="td-li" > <a (click)="open(i)" class="mdc-button ori-text" *ngIf="i.status==='待发货'"> 发货 </a> <a (click)="open(i)" class="mdc-button ori-text" *ngIf="i.status==='已完成'"> </a> <a (click)="open(i)" class="mdc-button ori-text" *ngIf="i.status==='已发货'"> 修改 </a> </div></td> View Code <a (click)="open(i)" class="mdc-button ori-text"> {{i.status === '已完成' ? '' : '发货' }} </a> 来源: oschina 链接: https://my.oschina.net/u/4344780/blog/4007022

Angular指令 *ngIf else 使用

你。 提交于 2020-12-16 12:11:40
Angular 中常用的指令有用来遍历的 *ngFor 、控制元素显示隐藏的 *ngIf ,今天学习一下 *ngIf 这个常用的指令。 在我们的实际业务中可能遇到这样的需求,一个 table 表格,最后一列有修改、删除或者其他操作,当我们点击修改按钮的时候,当前这一行的内容都出现在一个 input 输入框里面,然后我们可以直接进行修改,这个时候我们就可以使用 *ngIf 和 else 来实现。效果图如下: 部分实现代码: < tr *ngFor = " let item of gridList " > < td *ngIf = " item.bol; else inputid " > { {item.id}} </ td > < ng-template #inputid > < td class = " insert " > < input type = " text " [value] = " item.id " > </ td > </ ng-template > ... </ tr > 这里的 inputid 可以理解为一个模板 id ,它指向 <ng-template #inputid> 这个模板,当 item.bol 为 false 时,angular就会找到这个模板里的内容进行替换。 注意这个模板 id 是唯一的,如果多次使用 *ngIf else 指令需要使用不同的

pass data between controllers in AngularJS dynamically [duplicate]

本小妞迷上赌 提交于 2020-12-16 07:18:25
问题 This question already has answers here : Share data between AngularJS controllers (11 answers) Closed 21 days ago . i have tow controller in angularjs. if one controller change data other controller display updated data. in fact first controller has a event that it occur second controller display it. for this propose i wrote a service. this service has tow function. here is my service code. app.service('sharedData', function ($http) { var data=[] return { setData: function () { $http.get('

Update data in (really) real-time with Javascript

痞子三分冷 提交于 2020-12-15 09:12:01
问题 hi I want to build a control panel for a web art application that needs to run in fullscreen, so all this panel, that controls stuff like colors and speed values, have to be located at a different window. My idea is to have a database storing all these values and when I make a change in the control panel window the corresponding variable in the application window gets updated too. So, it's basically a real-time update that I could do with AJAX setting a interval to keep checking for changes

Update data in (really) real-time with Javascript

强颜欢笑 提交于 2020-12-15 09:11:52
问题 hi I want to build a control panel for a web art application that needs to run in fullscreen, so all this panel, that controls stuff like colors and speed values, have to be located at a different window. My idea is to have a database storing all these values and when I make a change in the control panel window the corresponding variable in the application window gets updated too. So, it's basically a real-time update that I could do with AJAX setting a interval to keep checking for changes

Update data in (really) real-time with Javascript

荒凉一梦 提交于 2020-12-15 09:10:05
问题 hi I want to build a control panel for a web art application that needs to run in fullscreen, so all this panel, that controls stuff like colors and speed values, have to be located at a different window. My idea is to have a database storing all these values and when I make a change in the control panel window the corresponding variable in the application window gets updated too. So, it's basically a real-time update that I could do with AJAX setting a interval to keep checking for changes

Update data in (really) real-time with Javascript

早过忘川 提交于 2020-12-15 09:09:26
问题 hi I want to build a control panel for a web art application that needs to run in fullscreen, so all this panel, that controls stuff like colors and speed values, have to be located at a different window. My idea is to have a database storing all these values and when I make a change in the control panel window the corresponding variable in the application window gets updated too. So, it's basically a real-time update that I could do with AJAX setting a interval to keep checking for changes

Prevent multiple select to have the same value

北城以北 提交于 2020-12-13 04:24:06
问题 What it should do I want to prevent the user to be able to select twice the same option in multiple <select> having the same options. What it is doing When selecting a value on the first dropdown, the second won't have the option visible (great). But when selecting a value on the second dropdown (and the first one already have one), it's deleting all the selections. I end up with a selection [null, null] . Am I missing something? JSFiddle var app = angular.module('App', []); app.controller(