MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. StuGrunt
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Head first developing MM module for extreme beginners

      It is because there is an error (at least I think so - I am new too) and no instructions on where to put the function.

      1. change the Module.register(“MMM-Timetable”) to Module.register(“MMM-Test”)

      2. The article does not tell you where to put the getDom function when it is first introduced. Replace the getDom: function() {}. with the code shown. In other words, don’t just add it to the file. This article would have benefited from a final section that gave the entire code.

      I think the original author at least expected us to be very familiar with Node.js (fair enough), but alas, I am not so it took a bit of work to figure it out. :-)

      Here it is, for the first part:

      Module.register(“MMM-Test”, {
      defaults: {},
      start: function () {},

      getDom: function() {
      var element = document.createElement(“div”)
      element.className = “myContent”
      element.innerHTML = “Hello, World!”
      return element
      },
      notificationReceived: function() {},
      socketNotificationReceived: function() {},
      })
      _

      posted in Development
      S
      StuGrunt
    • 1 / 1