Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

ng-switch : onChange property #83

@amaurel

Description

@amaurel

ng-switch directive works fine with DynamicParser (initializer-dev.dart), but fails with StaticParser (initializer-prod.dart).

To reproduice the problem one can modify the index.html file of angular.dart.tutorial chapter 7 and add a ng-switch as follow

<div ng-switch="ctrl.nameFilter">
    <div ng-switch-when="1" >filter is one</div>                         
</div>
<div ng-if="ctrl.recipesLoaded && ctrl.categoriesLoaded">

Running it from dartium generate the following error :

The null object does not have a method 'call'.

NoSuchMethodError : method not found: 'call'
Receiver: null
Arguments: [""]

STACKTRACE:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#1 StaticParser._construct (package:angular/core/parser/static_parser.dart:28:45)

Interestingly to make it works I had to provide a dummy value for ng-switch onChange property as follow

<div ng-switch="ctrl.nameFilter" change="ctrl.nameFilter">
   <div ng-switch-when="1" >filter is one</div>                         
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions