I'm trying to create a list using directive ng-repeat(angular 1.4) with polymer elements(polymer 1.0), like the example below:
<paper-material data-ng-repeat="curso in cursos">
<div class="lista">
<paper-item role="listitem">
<paper-item-body data-ng-click="carregar(curso)">
<div class="first-line">{{ curso.nome | uppercase }}</div>
</paper-item-body>
<paper-icon-button data-dialog="removeItem" icon="close" data-ng-click="prepararRemover(curso)"></paper-icon-button>
</paper-item>
</div>
</paper-material>
The 'cursos' variable is filled on load page by this method using Restangular:
$scope.buscarCursos = function() {
var promise = Restangular.all('cursos').getList();
promise.then(function (response){
$scope.cursos = response.data;
});
};
On the load page it works ok. But if i call this method again(reloading the list), i get this error on angular:
console message: "Error: element is undefined".
If i remove all polymer elements and trying to load and reload page again, i don't had any problem.
I'm doing something wrong or is not possible to do that? In Chrome don't had this problem, only in Firefox.
Thanks.
Why are you trying to combine Polymer and Angular? In a lot of ways they are competing frameworks. There is an Angular Material Design implementation that you should probably considering using instead if your sole reason for Polymer is to try and get the Material Design spec into your project.