JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-controller="MeuController" ng-app>
<p>Texto: <input type="text" ng-model="texto" /></p>
<p>Texto digitado: {{texto}}</p>
<p>Tamanho do texto: {{tamanho}}</p>
</div>
JavaScript
function MeuController( $scope ) {
$scope.texto = '';
$scope.tamanho = 0;
function obterTamanhoTexto( newValue, oldValue, scope ) {
$scope.tamanho = $scope.texto.length;
}
$scope.$watch( 'texto', function(newValue, oldValue){
$scope.tamanho = $scope.texto.length;
} );
}