I am currently stuck on hopefully a simple problem:
I have a controller.js
app.controller('WizardCtrl', function ($scope) {
$scope.send = function() {
console.log($scope.isPasswordChanged)
}
});
My view.html
isPasswordChanged: {{ isPasswordChanged }} <br>
<update-password-field is-changed="isPasswordChanged"></update-password-field>
<button ng-click="send()"></button>
My directive.js
app.directive('updatePasswordField', function () {
return {
restrict: 'E',
scope: {
isChanged: "="
},
templateUrl: "password-field-directive.html",
link: function (scope) {
// some magic to set isChanged value to true of false
}
}
});
So in my view.html I can see the changes of "isPasswordChanged", to it is somehow in my $scope, but if I console.log($scope) the "isPasswordChanged" is not present.
Why and how to make it present?
console.log($scope)?sendfunction? can you provide working sample?