chore: dartfmt Dart code in the repo
This commit is contained in:
@ -6,10 +6,11 @@ import 'package:angular/application_factory.dart';
|
||||
import 'package:angular2/src/test_lib/benchmark_util.dart';
|
||||
|
||||
setup() {
|
||||
|
||||
var m = new Module()
|
||||
..bind(CompilerConfig, toValue: new CompilerConfig.withOptions(elementProbeEnabled: false))
|
||||
..bind(ScopeDigestTTL, toFactory: () => new ScopeDigestTTL.value(15), inject: [])
|
||||
..bind(CompilerConfig,
|
||||
toValue: new CompilerConfig.withOptions(elementProbeEnabled: false))
|
||||
..bind(ScopeDigestTTL,
|
||||
toFactory: () => new ScopeDigestTTL.value(15), inject: [])
|
||||
..bind(TreeComponent);
|
||||
|
||||
final injector = applicationFactory().addModule(m).run();
|
||||
@ -33,9 +34,9 @@ main() {
|
||||
|
||||
createDom() {
|
||||
zone.run(() {
|
||||
var values = count++ % 2 == 0 ?
|
||||
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*'] :
|
||||
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-'];
|
||||
var values = count++ % 2 == 0
|
||||
? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*']
|
||||
: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-'];
|
||||
|
||||
rootScope.context['initData'] = buildTree(maxDepth, values, 0);
|
||||
});
|
||||
@ -46,23 +47,21 @@ main() {
|
||||
}
|
||||
|
||||
@Component(
|
||||
selector: 'tree',
|
||||
map: const {'data': '=>data'},
|
||||
template: '<span> {{data.value}}'
|
||||
'<span ng-if="data.right != null"><tree data=data.right></span>'
|
||||
'<span ng-if="data.left != null"><tree data=data.left></span>'
|
||||
'</span>'
|
||||
)
|
||||
selector: 'tree',
|
||||
map: const {'data': '=>data'},
|
||||
template: '<span> {{data.value}}'
|
||||
'<span ng-if="data.right != null"><tree data=data.right></span>'
|
||||
'<span ng-if="data.left != null"><tree data=data.left></span>'
|
||||
'</span>')
|
||||
class TreeComponent {
|
||||
var data;
|
||||
}
|
||||
|
||||
buildTree(maxDepth, values, curDepth) {
|
||||
if (maxDepth == curDepth) return new TreeNode('');
|
||||
return new TreeNode(
|
||||
values[curDepth],
|
||||
buildTree(maxDepth, values, curDepth+1),
|
||||
buildTree(maxDepth, values, curDepth+1));
|
||||
return new TreeNode(values[curDepth],
|
||||
buildTree(maxDepth, values, curDepth + 1),
|
||||
buildTree(maxDepth, values, curDepth + 1));
|
||||
}
|
||||
|
||||
class TreeNode {
|
||||
@ -71,4 +70,3 @@ class TreeNode {
|
||||
TreeNode right;
|
||||
TreeNode([this.value, this.left, this.right]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user