Using: dart 2.0.0
How do you create components for AngularDart?
I have with no luck, looked at https://github.com/dart-lang/angular_components
I have done the following steps:
- stagehand package-simple
- added
exportto dart file withlibrary <packageName>; referenced the package in
pubspec.yamlYou must have a dependency on
build_runnerinpubspec.yaml. dev_dependencies: build_runner: >=0.8.10 <2.0.0 You must have a dependency onbuild_web_compilersinpubspec.yaml. dev_dependencies: build_web_compilers: >=0.3.6 <0.5.0Please check the following imports: `import 'package:<...>template.dart''
I have tried to build the package with:
webdev build
webdev could not run for this project.
You must have a dependency on `build_runner` in `pubspec.yaml`.
# pubspec.yaml
dev_dependencies:
build_runner: >=0.8.10 <2.0.0
You must have a dependency on `build_web_compilers` in `pubspec.yaml`.
# pubspec.yaml
dev_dependencies:
build_web_compilers: >=0.3.6 <0.5.0
Note: Using just a simple class, it works - but not with web components:
This works:
class Awesome {
bool get isAwesome => true;
}
This do not:
import 'package:angular/angular.dart';
@Component(
selector: 'my-card',
templateUrl: 'my_card.html',
styleUrls: ['my_card.css'],
directives: [coreDirectives],
// pipes: [commonPipes],
)
class MyCard {
var cardstring = 'My Card - string';
}
When using it in anyway:
<my-card></my-card>