2017-04-17 72 views
0

我是EmberJs的新手,我正在开发一个项目,我需要在由ember-cli生成的templantes中添加javascript和css属性,我的难处在于查找javascript和css文件修改Emberjs的属性

When I search the project for the class or id, it shows me only what is in the dist that can not be changed 

Can anyone with emberJS experience help me make these changes? 






Template with i w[enter image description here][1]anna to work: 

    <div class="top-banner"> 
    {{ top-banner pageBanner=model.news.banner }} 
    {{ search-component exchangeTypes=model.exchangeType}} 
    </div> 

    {{bread-crumbs breadcrumbs=breadcrumbs}} 

    <section class="container destaque noticia"> 
    {{title-content light=model.news.title}} 
    <div class="row informacoes-news"> 
     <div class="col-xs-12 noticia-texto"> 
     {{{model.news.content}}} 
     </div> 
    </div> 
    </section> 

    {{share-bar}} 
    <div class="col-md-1 col-xs-12 download-container"> 
     <a class="teste" href="{{model.news.pdf}}">Download</a> 
    </div> 

    {{featured-news type="featured_news" noticias=model.featuredNews news=true}} 

    {{contact-widget states=model.brazilState}} 

    {{rodape-sitemap}} 
+0

所以,你需要知道的.css文件和模板和控制器是在项目结构?你试过什么了? – sheriffderek

回答

0

这里是灰烬,捻一个基本的轮廓:https://ember-twiddle.com/f537e51449c1c49ae32794b9d15bc6ff?openFiles=templates.application.hbs%2C

这听起来像你继承了一些代码 - 和你一样会从花几个小时的灰烬中受益指导教程:https://guides.emberjs.com/current

快乐旅行!


application.hbs

<h1>{{appName}}</h1> 

<h2>this is the application.hbs template (base template)</h2> 

{{info-list}} 


控制器/的application.js

import Ember from 'ember'; 

export default Ember.Controller.extend({ 
    appName: 'this is a property value seen in the application template...', 
}); 


app.css

body { 
    background: lightgreen; 
} 


模板/组件/ INFO-list.hbs

<ul class='item-list'> 
    <li>...</li> 
</ul> 
+1

非常感谢,帮助了很多! –

+0

此外,组件的.js和.hbs文件与上面的控制器和模板对一样。您可以将其视为模块创建的“范围”。 – sheriffderek