javascript - angularjs and ng-init scope when data changes -


Then I have a calendar application, where the user just selects the start / end date and the click updates calendar does. It shows a calendar, however, I am having trouble adding new elements to the scope. For example, instead of continuously using the same function to calculate "cell date" for some cells from the initial date, number of weeks, number of weeks, etc. of the week, I want to get into the realm and everyone should use it. Either way I am unable to do this despite many efforts. In JSFiddle below, you will notice the month display days in the top right corner of each calendar cell. However, if you change the dates, to say a month ago, the "Sale date" is not updated on the day of the month update but in the cell!

For example, take "Sat July 05 2014". Update to start date 6/1, and so far the right cell is still "Sat July 05 2014," although the day of the month shows June 7! The related code is in the "Cassell" instruction and "Event" instructions. In Calcels, I am setting celld as ng-init = 'celld = cellDate (num, start_dt, $ index)'. Then in the events I just display using {{celld}}. I could get to work using celadet (num, start_dt, $ index) in events, but I really do not want to use the same function one hundred times a day. Is there any way that I can store the date of cell in cell object and just use it in children's scope and can update it after data changes? Eventually, I will send the cell date to the function to get event data for that date, then the event will be repeated from them to display the event data.

  app.directive ("events", function ($ compilation, date service) {return: "a", replace: correct, scope: right, template: "
{{celld}} & lt; / div & gt;", link: function (region, element, ethers) {scope.DateService = DateService;}}}); // Calendar Cell App Replace: correct, scope: true, template: "& lt; td ng-init = 'celld = cellDate (" cylsal ", function ($ compilation, date service) {return: {AC :," A " Num, start_dt, $ index) 'id =' {{\ "td \" + DateService.getDateInt (soldet (num, start_dt, $ index))} '\ realclass =' ​​{{getScopeClass (sentendom (num, Start_dt, $ index))} & lt; div & gt; & lt; one class = 'selgee' & gt; {{DateService.getMonthDay (sendend (num, start_dt, $ index)}} }

























& Gt; & lt; div event & gt; & lt; / div & gt; \ & lt; / div & gt; \ & lt; / td & gt ;, link: function (scope, element, etter S) {scope.DateService = DateService;}}});

Thanks!

I was not able to work on it by putting celld on the event tag that if it helps is.

  & lt; Div event ng-attr-celld = '{{soldet (num, start_dt, $ index)}}' & gt; & Lt; / Div & gt;  

There is no need to change this and there is a difference between the ether radius value.

// replaces: true, ... scope: {celld: '@'}

And if You have not already seen - - You can save some time.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -