javascript - My ng-change is not firing on my Angular/Rails app -


I am creating a notecard application and for some reason my ng-change is not firing at all. I do not know what the problem is, I tried a breakpoint in JS, to verify that it is not actually firing. I think I'm missing something, it's positive. I just need the eyes of the other eyes.

Here js

  var app = angular.module ('catalyst', ['fay']); App.factory ('faye', ['$ fay', function ($ faye) {return $ fa ("http: // localhost: 9292 / faye");}]); App.directive ('stickyNote', function (feather) {var linker = function (area, element, ethers) {element.draggable ({stop: function (event, ui) {Faye.publish ('/ UI / board', {Id: scope.note.id, x: ui.position.left, y: ui.position.top});}}); Fei subscribe ('/ ui / board', function (data) {// if update If the same note (data. Id == scope.note.id) {element.animate ({left: data.x, top: data.y});}}); // To create it, some DOM start Element Element.css ('top', '50px'); element.hide (). FadeIn ();}; var controller = function .subscribe ('/ UI / board', function (data) {// update if same note if (data.id == $ scope.note.id) {$ scope.note. Title = data.title; $ Scope.note.body = data.body;}}; // Outgoing $ scope.updateNote = function (note) {Faye.publish ('/ UI / board', note);}; $ Scope.deleteNote = {{scope.ondelete ({id: id}}}}}}} return; Restrict {restrict: 'a', link: linker, controller: controller, area: {note: '= ', Ondial:' & amp;;};}); App.controller ('MainCtrl', function ($ scope, faye) {$ scope.notes = []; // their favorite sbib ('/ ui / board', function (data) {$ scope.notes.push (data) );});) Feasubib ('/ ui / board', function (data) {$ scope.handle deleted notes (data. Id);}); // Outgoing $ scope.createNote = function () {var note = {ID: new date (): match-time (), title: 'new note', body: 'pending'}; $ Scope.Notes. Pat (note); FeePublish ('/ U / Board', note); }; $ Scope.deleteNote = Function (id) {$ scope.handle Deleted Noted (ID); FeePublish ('/ UI / Board', {ID: ID});}; $ Scope.handle deleted Notted = function (id) {Var oldNotes = $ scope.notes, newNotes = []; Angular.forEach (old notes, function (note) {if (note.id! = Id) newNotes.push (note);}); $ Scope.notes = newNotes; }});  

here ui / board.html.haml

 % body {"ng-controller" => "Mankutton"}% nav.top-bar {"data-topbar" = & gt; ""}% Ul.title-area% li.name% h1% a {: href = & gt; "#"} AngelsJS CallBoard% li.toggle-topbar.menu-icon% a {: href = & gt; "#"}% Duration menu% section.top-bar-section% ul.right% li% a # createButton {"ng-click" = & gt; Create the "CreateNote ()"} note .alert-box.success.radius.sticky-note {"ng-repeat" => Note in "Notes $ tracked by Index", Note = & gt; "Note" ,: ondelete => "Delete Note", "Sticky-Note" = & gt; ""}% Button.close {"ng-click" => "DeleteNote (note.id)") ,: Type = & gt; "Button"} & amp; times; % Input.title {"ng-change" = & gt; "Update Note (Note)", "NG-Model" = & gt; "Notitles" ,: Type = & gt; "Text"}% textarea.body {"ng-change" = & gt; "Update Note (Note)", "NG-Model" = & gt; "Note.body"} {{note.body}}  

There's a lot here To look at, I believe you have a problem. For one, you are not using inside your directorate and therefore your child's elements will not be included in your compilation instructions. I also noticed that you have deleted notes on your main controller and are appointing the ads for the chief controller, but then keep UpdateNote only on the instruction. I think your deletion is working, you are using ng-repeat, which creates a child's scope for each "note"


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -