1
I’m trying to make a simple directive on Angling for example.
This is a button that takes the class name and text as follows:
var app = angular.module('app', [])
.controller('appController', ['$scope', function($scope) {
$scope.alertar = function() {
alert('alertando');
}
}])
.directive('botao', function() {
return {
restrict: 'E',
templateUrl: 'js/diretivas/botao.html',
scope: {
classe: '=',
texto: '='
}
};
});
In boot.html, I have:
<button class="{{ classe }}">{{ texto }}</button>
I call the directive in index.html as follows:
<botao classe="btn" texto="Teste"></botao>
What am I doing wrong? The button appears, but without the class and without the text.