更新 1:开发了第一个示例代码,为正确实施奠定基础。
更新 2:开发了一个工作模型。见答案。
我找到了这个库:
https://libraries.io/bower/editable-dropdown-angularjs
它允许使用 HTML5 数据列表功能添加可编辑的下拉列表。
它工作正常,但是,唯一需要的功能是仅当所选值为“其他”时才使字段可编辑。
根据存储库中的演示查看 plunkr.co vreated 中的工作示例
http://plnkr.co/edit/wDm2mbTqTsT1YC5H7UPy?p=preview
有关详细信息,请参阅下面的示例代码。
感谢您的建议,使下拉字段仅在所选值为“其他”时可编辑。
HTML5:
<div ng-app="myApp">
<div ng-controller="demo" style="width:300px;position:fixed;top:20px;left:20px">
<p>You selected {{selected}}</p>
<editable-dropdown options='list' ng-model='selected'></editable-dropdown>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
JavaScript:
angular.module('myApp', ['editableDropdown'])
.controller('demo', function($scope){
$scope.list = ['one', 'two', 'other']
$scope.selected;
});
Run Code Online (Sandbox Code Playgroud)
我能够使用 jsfiddle 开发这个示例代码(基于这个答案):
http://jsfiddle.net/tarekahf/t392djx1/
如果选择“其他”,这将允许使下拉列表可编辑。现在,我正在将此模式转换为 Angular 方式。如果您有任何建议,请告诉我。
我正在尝试解析以下输出:
wmic copmutersystem
Run Code Online (Sandbox Code Playgroud)
和
net.exe config workstation
Run Code Online (Sandbox Code Playgroud)
使用 PowerShell 获取对象作为键/值对和/或将其转换为 JSON 字符串。
我知道有一个 PowerShell 等效命令:
Get-CimInstance -Class Win32_computersystem
Run Code Online (Sandbox Code Playgroud)
但这里的问题是弄清楚如何使用 PowerShell 解析wmicCMD 行的类似输出。
在某些情况下,我在功能分支上执行 git pull 操作,最终得到多个烦人的“合并提交”,我可以理解它们为什么会发生,但我想将它们合并起来,使其看起来像正常提交。
我尝试使用git rebase -i --rebase-merges HEAD~4但无法弄清楚如何压缩合并提交。
我做了进一步的研究,经过大量的挖掘,我能够执行以下操作,使用 rebase 将不需要的合并提交合并到正常提交中,然后在需要时压缩它们:
git checkout feature
git pull # will create merge commits
git checkout featur_backup # to create a backup
git switch --orphan emty_commit
git commit -m "First empty commit for the feature branch" --allow-empty
git switch feature
git rebase empty_commit
git rebase -i --root # this allows you to squash commits
git branch -D empty_commit
Run Code Online (Sandbox Code Playgroud)
有没有更好的方法来合并合并提交?
笔记: