textContent Material Designer Angular JS

Asked

Viewed 188 times

3

I’m using the Angularjs Material Dialog and it’s okay, but when I put the textContent it returns the following error:

CONSOLE ERROR

 $mdDialog.confirm(...).title(...).textContent is not a function

JS

var confirm = $mdDialog.confirm()
              .title('Você tem certeza que deseja excluir esta categoria?')
              .textContent('Esta ação é irreversível')
              .ariaLabel('Excluir')
              .targetEvent(ev)
              .ok('Sim tenho certeza!')
              .cancel('Não excluir');

        $mdDialog.show(confirm).then(function() {
            // ok
        }, function() {
          // cancelado
        });

Why this textContent is not accepted? The example is the same as the Angular JS Material.

  • 2

    Your Angularjs/Material is the same version of the example on the site?

  • 2

    You are probably using a version that does not support the .textContent

  • Yes I was with an earlier version, I’m getting used to the change that Angular has subsequently rs

  • 1

    @user3801617 get ready for more changes, Angular 2.0 is coming rs. Solved the problem?

  • 2

    @Shelon In all fairness, who changed was mdDialog, not Angularjs itself. But Techies is fully correct, 2.0 is completely different. =)

  • 1

    @Techies All settled, thank you

Show 1 more comment

1 answer

5

The version you are using probably predates 1.0.0, in previous versions rather than textContent the function was called only content.

You can follow the examples of the official website according to the version you are using, just change where it shows the image below.

inserir a descrição da imagem aqui

  • 1

    +1 for the cute image. Just complementing, I think you can use content in place of textContent. I saw it thanks to @devgaspa’s reply

Browser other questions tagged

You are not signed in. Login or sign up in order to post.