i wanna use angular js with bootstrap, so plz suggest me how..?
<div ng-app="myApp" ng-controller="myCtrl" class="container">
<div class="row">
First Name:
<input type="text" ng-model="firstName">
</div>
Last Name:
<input type="text" ng-model="lastName">
<br>
<br> Full Name: {{firstName + " " + lastName}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
</script>
its not working.
答案 0 :(得分:0)
添加:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc= sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha256-Sk3nkD6mLTMOF0EOpNtsIry+s1CsaqQC1rVLTAy+0yc= sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
到<head>
部分
答案 1 :(得分:0)
添加标签<head>
,Bootstrap需要jQuery,你需要添加Angular API
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
答案 2 :(得分:0)
最好使用bower作为前端依赖管理器。打开shell - &gt; gitbash。输入npm install -g bower
。暗示!鲍尔需要npm,所以如果你没有npm安装它首先!转到项目路径,然后运行bower install bootstrap
。在此之后您将注意到项目路径中的新文件夹。这个解决方案是最好的,因为总是得到最新的发布,所有依赖和甜文件夹结构。我强烈建议使用凉亭。看看一些gitbash repos,并注意到大多数插件都有凉亭安装指南。链接deps,如index.html或其他一些视图文件,对所有视图都是通用的。记得放入身体的底部,不要冻结页面渲染。