标签:john sni script scope pen 功能 spl pretty his
1.如果要在modal弹出显示框的显示内容里面增加ng-show之类的判断时,要将需要判断的$scope变量通过resolve导入子控制器中,然后在子控制器中的$inject和constructor里面声明这些$scope变量,这样就能在
<script type="text/ng-template" id="template/~~~.html"></script>里面使用这些$scope变量来进行判断了。
2.如果要使用modal的.result.then并且在其中调用其他功能的话,那么就必须在子控制器中加入this.$uibModalInstance.close(true);这一句才行。
3.check the difference between two arrays of objects in javascript
1 var b1 = [ 2 { id: 0, name: ‘john‘ }, 3 { id: 1, name: ‘mary‘ }, 4 { id: 2, name: ‘pablo‘ }, 5 { id: 3, name: ‘escobar‘ } 6 ]; 7 8 var b2 = [ 9 { id: 0, name: ‘john‘ }, 10 { id: 1, name: ‘mary‘ } 11 ]; 12 13 var res = b1.filter(item1 => !b2.some(item2 => (item2.id === item1.id && item2.name === item1.name)));
标签:john sni script scope pen 功能 spl pretty his
原文地址:https://www.cnblogs.com/shoukaku/p/11616449.html