What Is the Replacement for the #Decorator Directive? - dart

I'm upgrading my dart code from angular 1 to angular 4.
This line now gives an error in my IDE:
#Decorator(selector: '[citable]')
Annotation must either be a const variable or const construction invocation.
I was able to fix this error on #Input by including the formDirective. What directive should I use for #Decoration? I can't find any recent mention of #Decorator in a web search for AngularDart.
I tried adding const after selector:. Then I get a syntax error.

The replacement is #Directive.

Related

How to use if inline helper in glimmer application

when i tried to use if helper in glimmer application.It gives me an error like Uncaught Error: Compile Error: if is not a helper
EDIT: Starting with v0.8.0 there is an inline if.
The version of Glimmerjs you are using does not have an inline if helper, you can either implement it yourself or upgrade your Glimmerjs project to v0.8.0.
To create the helper, run ember g glimmer-helper if, and then edit the file with the following:
// src/ui/components/if/helper.ts
export default function helper([cond, truthy, falsy]) {
return cond ? truthy : falsy;
}
To update, I suggest using ember-cli-update. On top of upgrading your dependencies, you will also have to update your components to the new <Capital> syntax.

Dart Polymer : Type X is not a subtype of type Y

I develop my application with Dart and Polymer on PyCharm. I currently have an error :
Exception: type 'ObservableList<DrugFilterItem>' is not a subtype of type 'ObservableList<DrugCompareItem>' of '__$orderFilterList#51385934'
ObservableList is from package:observe/src/observable_list.dart
DrugFilterItem is from package:synmed/drug_elements/views/drug_filter_menu.dart
ObservableList is from package:observe/src/observable_list.dart
DrugCompareItem is from package:synmed/drug_elements/views/drug_search_toolbar.dart
DrugFilterItem and DrugCompareItem are both custom classes, DrugCompareItem extends DrugFilterItem, and the line designed by the error is :
ObservableList<DrugCompareItem> orderFilterList = new ObservableList<DrugFilterItem>();
The problem suddenly happened today : I installed Pycharm 2016.3 and tried to code, but I had an error with the package shadow, which I solved. Since, I have this error which I supposed came from a problem with the packages as the code didn't change from before to after.
What I have found for now is nothing in fact, I read a lot of post on this kind of error, one of the recurrent subject was the imports but I didn't find any problem with this. I am using Dart 1.20.1 and
polymer: "<=0.16.4+1"
core_elements: "<=0.7.1+3"
paper_elements: "<=0.7.1"
Do anyone has any clue for me? Thanks!
Sounds like https://github.com/dart-lang/sdk/issues/14972#issuecomment-108402835
I believe this is working as intended. A List is not assignable to a List, even if it only contains Apples.
There are several ways to work around this:
iterable.map((x) => x) (removing the generic type),
new List<MethodMirror>.from(iterable)
new MyIterableWrapper<MethodMirror>(iterable) (where the iterable-wrapper that would need to be written).

Debugging MirrorsUsed

I'm trying to figure out which libraries I need to pass to #MirrorsUsed to get my app compiled and working. Sometimes, it's easy to figure out which library may be missing since a descriptive error is thrown such as Uncaught Unsupported operation: Cannot find class for: NgAttr .
Other times, I get a more obscure message, such as NullError: Cannot call "$gt" on null with no clue as to which library I may be omitting. Is there a better approach to this, besides trial and error?
In case you're wondering, this is an angular app and this is how I currently have it configured:
#MirrorsUsed(targets: const[
'angular',
'angular.core',
'angular.core.dom',
'angular.filter',
'angular.perf',
'angular.directive',
'angular.routing',
'angular.core.parser.dynamic_parser',
'angular.core.parser.lexer',
'todo',
'perf_api',
'List',
'NodeTreeSanitizer',
'PlaybackHttpBackendConfig'
],
override: '*')
import 'dart:mirrors';
Use
pub build --mode=debug
this does tree shaking but retains (mostly) the original Dart names.
Then debugging the generated JavaScript usually lets deduce the source of the exception.
EDIT
IMHO these are not necessary anymore, because they were added to #MirrorsUsed in the Angular libs.
'angular',
'angular.core',
'angular.core.dom',
'angular.filter',
'angular.perf',
'angular.directive',
'angular.routing',
'angular.core.parser.dynamic_parser',
'angular.core.parser.lexer',

HDF5 example not working

I tried building the first example here and got errors. Right on the first line there's a missing include statement, but I managed to figure out it should be
#include "hdf5.h"
But even after fixing that I got more errors:
$ h5cc ./example1.c
./example1.c: In function ‘main’:
./example1.c:66:4: error: too few arguments to function ‘H5Dcreate2’
In file included from /usr/include/hdf5.h:27:0,
from ./example1.c:6:
/usr/include/H5Dpublic.h:104:14: note: declared here
Any idea how to solve it?
The example code was written for release 1.6 of hdf5, and as such will simply not compile on a 1.8 release without modification.
If you want to get the code to work on 1.8, you need to enable 1.6 compatibility, which means passing in the flag:
-DH5_USE_16_API
to the h5cc command line like:
h5cc -DH5_USE_16_API ./example1.c
and it should compile correctly; otherwise you will have to rewrite the code to make use of the 1.8 API.

FsLex changed with latest PowerPack?

I've been working on a compiler for a while but after changing to PowerPack 1.9.9.9 and the release version of VS2010 I'm no unable to compile the following line:
let lexbuf = Lexing.from_string text
I get the following two error:
"The value, constructor, namespace or type 'from_string' is not defined" pretty obviopus what it's trying to tell me but what's the resolution?
My quick guess is that this function has been renamed to fromString (because, in general, functions with underscores such as of_seq are now written in camelCase).
Lexing.LexBuffer<_>.FromString ?

Resources