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.

In Firefox combining ng-if and ng-repeat results in an empty element  #1306

Open
@lasse-damgaard

Description

@lasse-damgaard

Using a combined ng-if and ng-repeat on an element works in Chrome but not in Firefox (31.0 in OSX). The element is given the ng-bind class but is otherwise empty. If I move the ng-if to an outer div it works.

So, given the example below:

  • In Chrome the page contains "123 456"
  • In Firefox it contains just "123".

There are no errors or warnings logged in the console when doing this.
This occurs in both 0.12 and 0.13

index.html

<!DOCTYPE html>
<html ng-app>
<body>
<span ng-repeat="item in [1,2,3]">{{item}}</span>
<span ng-if="true" ng-repeat="item in [4,5,6]">{{item}}</span>
<script type="application/dart" src="main.dart"></script>
<script type="text/javascript" src="packages/browser/dart.js"></script>
</body>
</html>

main.dart

import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';

void main() {
    applicationFactory().run();
}

Resulting page in Firefox

<!DOCTYPE html>
<html class="ng-binding" ng-app="">
<head></head>
<body class="ng-binding">
<span class="ng-binding" ng-repeat="item in [1,2,3]">1</span>
<span class="ng-binding" ng-repeat="item in [1,2,3]">2</span>
<span class="ng-binding" ng-repeat="item in [1,2,3]">3</span>
<span class="ng-binding" ng-repeat="item in [4,5,6]" ng-if="true"></span>
<script src="http://localhost:8080/main.dart.js">
<script src="packages/browser/dart.js" type="text/javascript">
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions