angularjs

Prevent multiple select to have the same value

眉间皱痕 提交于 2020-12-13 04:24:05
问题 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(

How can I fix org.jvnet.mimepull.MIMEParsingException?

半腔热情 提交于 2020-12-12 10:00:26
问题 While uploading a image/doc/xlsx file from my AngularJS client to my server-side java using JAX-RS(Jersey) i am getting the following exception, org.jvnet.mimepull.MIMEParsingException: Reached EOF, but there is no closing MIME boundary. What is this? Why I am getting this exception? How can I get rid of this? Note : It works for the files with extension .txt, .html, .yml, .java, .properties But not working for the for the file with extension .doc, .xlsx, .png, .PNG, .jpeg.. etc. My Server

How can I fix org.jvnet.mimepull.MIMEParsingException?

醉酒当歌 提交于 2020-12-12 10:00:09
问题 While uploading a image/doc/xlsx file from my AngularJS client to my server-side java using JAX-RS(Jersey) i am getting the following exception, org.jvnet.mimepull.MIMEParsingException: Reached EOF, but there is no closing MIME boundary. What is this? Why I am getting this exception? How can I get rid of this? Note : It works for the files with extension .txt, .html, .yml, .java, .properties But not working for the for the file with extension .doc, .xlsx, .png, .PNG, .jpeg.. etc. My Server

TypeScript 新特性介绍

房东的猫 提交于 2020-12-11 17:43:49
TypeScript 字符串新特性 多行字符串 JavaScript 定义多行字符串 var word = 'aaa' + 'bbb' + 'ccc' TypeScript 定义多行字符串 var word = ` aaa bbb ccc ` 字符串模板 var myName = "Zhang San"; var getName = function() { return "zhangsan" } console.log(`hello ${myName}`); console.log(`hello ${getName()}`); 自动拆分字符串 function test(template, name, age) { console.log(template); console.log(name); console.log(age); } var myName = "Zhang san"; var getAge = function() { return 18; } test `my name is ${myName}, I'm ${getAge()}`; 参数新特性 参数类型 在参数名称后面使用冒号来制定参数的类型 声明类型 any string number booleam void (不需要返回值的函数) var myName: string = "zhang san";

阿里技术总监打造516页全栈技能修炼手册,全栈,不是特定技术的组合,而是一种思维方式,一种眼界!

ε祈祈猫儿з 提交于 2020-12-11 13:29:39
有言在先 全栈,是技术领域的一条 Hard Way,选择它,你就要付出很多额外的努力——并非是996,而是通过更多、更努力的思考(工作955,思考7×24)。其回报则是在多年之后,每当别人提起你时都会不禁赞叹:“瞧那位 Hardcore 的程序员!”没有付出就没有回报。相对于少数几条 Hard Way 来说,世界上还有无数条 Easy Way。如果你对 Hard Way 有着恐惧或犹疑,那么,请放下这本书,随便拿起一本“21天精通×××”。 如果这都没有吓跑你,那么我要向你透露一个价值连城的秘密——“全栈并不难”。至少,对勤于思考的人来说,全栈是一个自然而然的结果,并不需要额外的代价。你之所以曾经觉得全栈难,是因为眼界受到限制。今天小编分享一份 全栈技能修炼:使用Angular和Spring Boot 打造全栈应用。 与通常的理解不同,在我看来,全栈,不是特定技术的组合,而是一种思维方式,一种眼界。即使这本书讲的是 Angular + SpringBoot,即使我是在 Angular 领域的Google开发者专家,我仍然要郑重提醒你——阅读时请跳出具体的技术,努力从更高的层次上理解它。 内容目录 由于篇幅限制,小编进展了部分内容。需要获取这份 全栈技能修炼:使用Angular和Spring Boot 打造全栈应用454页文档的小伙伴可以一键三连后,添加小助理:VX

前端的自动化重构

我是研究僧i 提交于 2020-12-11 09:27:28
过去,我一直想着抽时间写一个小的前端工具,以对代码进行自动化的重构。但是呢,经过我再三的考虑,我暂时取消了这个打算 —— 主要是没时间。(PS:人生长乐,写个 Charj) 但是呢,我打算写一篇文章记录一下相关的思路。 原因依据很多: 大部分国内的公司使用的都是 Vue,template、script、style 都耦合在一起; 大量的前端项目都是轻逻辑,不具有复杂的业务场景 前端系统被重写的频率太快了 JavaSript 语法太灵活,而 TypeScript 还未普及 …… 简单来说,在缺乏复杂场景的情况下,我不太想去写这样的工具。 如何构建前端自动化重构工具? 在我之前写的那篇『重构的自动化』中,介绍了如何去做这样的工具: 构建特定语言的语法解析器。 设定代码坏味道的内容及标准。 针对于每一项坏味道,编写识别代码。 编写代码坏味道的建议改进和实施代码。 实现坏味道的自动化重构。 以 Vue 为例,这个过程便是: 寻找适用于 Vue 的 AST 生成工具。如 eslint-vue-parser 寻找和编写适用于 Vue 编码的相关规范。 对应规范寻找代码中的问题。 针对该问题寻找改进点 实现自动化重构 让我们来看个简单的示例,如我们的代码规范中,针对于 组件库 强制规范了一定要写 scoped 。而我们有大量的组件都没有相应的实践。这个时候,就可以通过这种方式来处理

Find all the parents of each element

左心房为你撑大大i 提交于 2020-12-09 16:16:36
问题 I'm trying to create a breadcrumb without using the url (the route provider) and without using jQuery. I have a tree like that Humans Trees Animals Cats Lions Dogs Terrier Bulldog Cocker Cars and I'd like when I click on Cocker to display Animals / Dogs / Cocker So, I created a recursive function in order to find parent/parents for each element that I click on but it doesn't work correctly. It finds that an element has a parent, it also finds the first parent of an element but it doesn't show

Find all the parents of each element

寵の児 提交于 2020-12-09 16:10:46
问题 I'm trying to create a breadcrumb without using the url (the route provider) and without using jQuery. I have a tree like that Humans Trees Animals Cats Lions Dogs Terrier Bulldog Cocker Cars and I'd like when I click on Cocker to display Animals / Dogs / Cocker So, I created a recursive function in order to find parent/parents for each element that I click on but it doesn't work correctly. It finds that an element has a parent, it also finds the first parent of an element but it doesn't show

Find all the parents of each element

拥有回忆 提交于 2020-12-09 16:06:09
问题 I'm trying to create a breadcrumb without using the url (the route provider) and without using jQuery. I have a tree like that Humans Trees Animals Cats Lions Dogs Terrier Bulldog Cocker Cars and I'd like when I click on Cocker to display Animals / Dogs / Cocker So, I created a recursive function in order to find parent/parents for each element that I click on but it doesn't work correctly. It finds that an element has a parent, it also finds the first parent of an element but it doesn't show

Check if value is not empty and not null in angular template?

落爺英雄遲暮 提交于 2020-12-09 00:44:25
问题 How do I check if value is not empty and not null. in Controller: $scope.data.variable = 'some valid data'; <div ng-if="data.variable != ''">something else</div> Thanks 回答1: since both null and empty are falsy values div.variable if not null or empty will evaluate to true and if either of null or empty will evaluate to false <div ng-if="data.variable">something else</div> 回答2: I suggest you have such a function is your controller: $scope.isEmpty = function(value){ return (value == "" || value