最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Angular boilerplate and Twitter Bootstrap 3 - Stack Overflow

programmeradmin1浏览0评论

I am trying to use this project but with Twitter Bootstrap 3. I find no posts on how to do that. Is it because:

  1. It can't be done
  2. It shouldn't be done
  3. I am the only one in the world who wants to do that
  4. There are other better ways to do that.

I am afraid that using Twitter Bootstrap 2.3.2 as this boilerplate code es with is old. Am I right?

I have tried to fix it myself but I give up the jungle world of JavaScript scripts and bugs that must be bined in a top secret order and maybe if you are lucky you don't get an error. Please help me.

I am trying to use this project https://github./ngbp/ngbp but with Twitter Bootstrap 3. I find no posts on how to do that. Is it because:

  1. It can't be done
  2. It shouldn't be done
  3. I am the only one in the world who wants to do that
  4. There are other better ways to do that.

I am afraid that using Twitter Bootstrap 2.3.2 as this boilerplate code es with is old. Am I right?

I have tried to fix it myself but I give up the jungle world of JavaScript scripts and bugs that must be bined in a top secret order and maybe if you are lucky you don't get an error. Please help me.

Share Improve this question edited Feb 24, 2014 at 21:47 LuckyLuke asked Feb 24, 2014 at 19:53 LuckyLukeLuckyLuke 49.1k87 gold badges279 silver badges448 bronze badges 7
  • It's using an extremely old version of UI-bootstrap. Looks like he could use a pull request with some much-needed updates. Maybe I'll dig into that tonight. – moribvndvs Commented Feb 24, 2014 at 19:57
  • This is a better choice for angular+bootstrap: github./yeoman/generator-angular – Nathaniel Johnson Commented Feb 24, 2014 at 20:12
  • @NathanielJohnson Does that use Twitter bootstrap 3 – LuckyLuke Commented Feb 24, 2014 at 20:16
  • Yes. And it is the preferred method. I would also add that you will want to use Angular-Bootstrap. – Nathaniel Johnson Commented Feb 24, 2014 at 20:17
  • angular-ui.github.io/bootstrap – Nathaniel Johnson Commented Feb 24, 2014 at 20:17
 |  Show 2 more ments

1 Answer 1

Reset to default 7

I consider using Yeoman good practice for scaffolding out new projects. The advantage to using Yeoman is that it creates the more arcane files used by Grunt (a build tool) and Bower (a dependency management tool). There is a generator for Angular. It will allow you to pick a good working set of libraries, create the project, and add more ponents that you find necessary later. Yeoman is really just Grunt+Bower and then Yo - a tool for stubbing out project skeletons. The nice thing is that you can continue to add Angular ponents after creating your project and it will update your config files letting you play around with the structure.

If you would like to use Bootstrap 3, I suggest looking at Angular-Bootstrap which is part of the Angular UI group of projects. Angular Bootstrap contains the portion of Bootstrap that is javascript but is rewritten to use angular style directives.The CSS and icons must still be included and can be found in the normal bootstrap library. The instructions for including the Bootstrap CSS and some great plunker examples are available in the Angular-UI readme.

Update Here is what a bower.json might look like. Notice that bootstrap is included separately. This is because the bootstrap css is a separate dependency so that angular-ui does not need to be updated whenever bootstrap is.

{
    "name": "test",
    "version": "0.0.1",
    "ignore": [
        "**/.*",
        "node_modules",
        "lib",
        "test",
        "tests"
    ],
    "dependencies": {
        "angular": "latest",
        "angular-route": "latest",
        "angular-bootstrap": "latest",
        "angular-ui-utils": "latest",
        "bootstrap": "latest",
    },
    "devDependencies": {
        "angular-mocks": "latest",
        "angular-scenario": "latest"
    }
}
发布评论

评论列表(0)

  1. 暂无评论