Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
103 views
in Technique[技术] by (71.8m points)

javascript - Ember routes not displaying template content

For some reason, all Ember routes stopped working for me. I was working on a login route, where a login pop-up appears. Everything worked fine. After I saved the changes, made sure again that it's working and closed everything, upon starting the app again all routes stopped working - they don't display any content. The main page/route works still fine.

I tried to restart my pc and the app. I tried to overwrite the login route. I tried to generate entirely new route with just some basic "Hello" line to see if it's working (it's not). I even tried to create an entirely new app, still not working.

I use ember g route XY to generate routes.

Here is how the login template looks (was fully functionable):

{{page-title "Login"}}

{{content-for "body"}}
<div id="popup" class="modal-bg">
    <div class="modal">
      <div class="center">
        <form action = "#">
          <div class="data">
            <span class='label'>Email or Username</span>
            <input type="text" required>
          </div>
          <div class="data">
            <span class='label'>Password</span>
            <input type="password" required>
          </div>
          <div class = "forgot-pass"><a href="">Forgot password?</a></div>
          <div class = "btn">
            <div class= "inner"></div>
            <button type = "submit">Log in</button>
          </div>
        </form>
      </div>
    </div>
  </div>


<script>
 var modal = document.getElementById('popup');

 window.onclick = function(event) {
   if (event.target == modal) {
     window.history.go(-1); return false;
   }
 }
</script>
{{outlet}}

Here is some basic route template which is supposed to write "hello" under the footer, but it also doesn't work anymore

 {{page-title "About"}}
   <p>hello</p>>
 {{outlet}}

Any ideas what is the cause and how can I fix it? Thank you!

question from:https://stackoverflow.com/questions/65888424/ember-routes-not-displaying-template-content

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...