This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExemploComponentWillUnmount extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| componentWillUnmount() { | |
| //executa alguma ação | |
| } | |
| //outros metodos ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExemploComponentWillReceiveProps extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| componentWillReceiveProps() { | |
| //executa alguma ação | |
| } | |
| //outros metodos ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExemploComponentWillMount extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| componentDidUpdate() { | |
| //executa alguma ação | |
| } | |
| //outros metodos ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExemploComponentWillMount extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| componentWillUpdate() { | |
| //executa alguma ação | |
| } | |
| //outros metodos ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExemploComponentWillMount extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| shouldComponentUpdate(nextProps, nextState) { | |
| //alguma ação a ser tomada | |
| } | |
| //outros metodos ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExemploComponentDidMount extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| componentDidMount() { | |
| //executa alguma coisa depois da montagem do compoente no DOM | |
| } | |
| //outros metodos ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Clock extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = {date: new Date()}; | |
| } | |
| render() { | |
| return ( | |
| <div> | |
| <h1>Hello, world!</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExemploComponentWillMount extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| componentWillMount() { | |
| //executa alguma coisa antes da montagem do compoente no DOM | |
| } | |
| //outros metodos ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> | |
| <body> | |
| <script> | |
| angular.module("meuViadinhoFavoritoApp", []); | |
| angular.controller("myCtrl", function ($scope) { | |
| vm = this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> | |
| <body> | |
| <script> | |
| var app = angular.module("myShoppingList", []); | |
| app.controller("myCtrl", function ($scope) { |