Skip to content

Instantly share code, notes, and snippets.

@limitingfactor
limitingfactor / gist:7905312
Last active December 31, 2015 00:09
Release[Board] Angular JS Gotchas #1: The Gotcha occurs when you attempt to modify the parent scope from the child scope. In this situation, the child scope will create a duplicate scope variable and not update the parent scope variable. This can lead to data-binding breaking in your Angular App. To remedy this issue, add a setter method in the …
<!-- Angular JS Gotchas http://releaseboard.com -->
<div ng-controller="ParentCtrl">
<!-- Lots of HTML -->
{{ release.name }} <!-- This won't update if you update the release name from the child -->
<div ng-controller="ChildCtrl">
<!-- Lots of HTML -->
{{ release.name }}
</div>
</div>
@limitingfactor
limitingfactor / gist:7905219
Last active December 31, 2015 00:09
Release[Board] Angular JS Gotchas #1: The Gotcha occurs when you attempt to modify the parent scope from the child scope. In this situation, the child scope will create a duplicate scope variable and not update the parent scope variable. This can lead to data-binding breaking in your Angular App. To remedy this issue, add a setter method in the …
//Angular JS Gotchas http://releaseboard.com
app.controller('ParentCtrl', function ($scope, Release) {
$scope.release_data = Release.get({}, function() {
$scope.release = $scope.release_data.release;
});
$scope.setRelease = function(release) {
$scope.release = release;
}