我是Angular JS的初学者.我正在通过以下链接. http://docs.angularjs.org/tutorial/step_00
什么是引导程序文件?他们在哪里?
什么是自动引导和手动初始化引导?我从链接http://docs.angularjs.org/guide/bootstrap中读到了手动初始化的缺点,如下所示
任何人都可以解释这里的缺点究竟是什么?
模式定义
Team.js
var TeamSchema = new Schema({
// Team Name.
name: String,
lead: String,
students :type: [{
block : Number,
status : String,
student : {
type: Schema.ObjectId,
ref: 'Student'
}]
});
Run Code Online (Sandbox Code Playgroud)
Student.js
var StudentSchema = new Schema({
name: String,
rollNo : Number,
class : Number
});
Run Code Online (Sandbox Code Playgroud)
如何填充"学生"以获得输出,如下所示:
球队
{
"__v": 1,
"_id": "5252875356f64d6d28000001",
"students": [
{
"__v": 1,
"_id": "5252875a56f64d6d28000002",
block : 1,
status : joined,
"student": {
"name": Sumeeth
"rollNo" : 2
"class" : 5
}
},
{ …Run Code Online (Sandbox Code Playgroud) 当我显示我的模态时,会自动调用onApprove事件.我怎么能阻止这个?我的代码如下
<div class="item">
<div class="content">
<a href="#" ng-click="showItemPanel()">Deactivate Account</a>
<div id='showItemModal' class='ui modal'>
<i class="close icon"></i>
<div class="header">
Deactivate User
</div>
<div class="content">
<form class="ui form" name="ItemModalForm">
<div class="field">
You want to go to shopping?
</div>
</form>
</div>
<div class="actions">
<div class="ui tiny button">Cancel</div>
<div class="ui tiny green button" ng-click="showItems()">De-Activate</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
controller.js
$scope.showItemPanel= function() {
var modalElem= $('#showItemModal').modal('setting', {
closable : false,
onDeny : function(){
window.alert('Wait not yet!');
return false;
},
onApprove : itemPanelOpen()
});
modalElem.modal('show');
}
function …Run Code Online (Sandbox Code Playgroud) 我从以下链接http://passportjs.org/guide/authenticate/了解到在passport.js中使用身份验证方法
在我的项目中,我有以下代码:
app.post('/login', function(req, res, next) {
passport.authenticate('local', function(err, user, info) {
if (err) { console.log(err); return next(err) }
if (!user) {
return res.json(400, info);
}
req.logIn(user, function(err) {
if (err) { return next(err); }
return res.json(200, {user_id: user._id, url:"/user/home"});
});
})(req, res, next);
});
Run Code Online (Sandbox Code Playgroud)
我在另一个文件中调用了/ login url,如下所示
$http.post('/login', $scope.user).
success(function(data, status, headers, config) {
$window.location.href= data.url ? data.url : '/';
$scope.view.loading = false;
}).error(function(data, status, headers, config) {
console.log(data);
$scope.view.loading = false;
$scope.view.submitted = true;
$scope.view.serverError=data.message ? …Run Code Online (Sandbox Code Playgroud) 我从互联网上得到了一个代码示例。我使用它,它工作正常。但我不明白代码的工作原理。
#header {
display: -moz-flex;
display: -webkit-flex;
display: -ms-flex;
display: flex;
-moz-justify-content: space-between;
-webkit-justify-content: space-between;
-ms-justify-content: space-between;
justify-content: space-between;
background-color: #ffffff;
border-bottom: solid 1px rgba(160, 160, 160, 0.3);
height: 3.5em;
left: 0;
line-height: 3.5em;
position: fixed;
top: 0;
width: 100%;
z-index: 10000;
}
Run Code Online (Sandbox Code Playgroud)
moz-flex 和 webkit-flex 代表什么?
谢谢,萨巴里斯里
我的jsbin链接在这里:http://jsbin.com/siyux/1/edit
以下是我的代码:
var dest = {
owner: '53a96efe07b7570013bdcb8b',
schedule: 'Thu Jul 03 2014 20:00:00 GMT+0530 (India Standard Time)',
_id: '53b55f52dafac9f40984fe30',
__v: 0,
a: [],
result:{
markCard: []
},
parent: {},
b: [],
c: [],
d: { teamRef: '53ad727d62290bc8178695fa', squad: [] },
e: { teamRef: '53ad726e62290bc8178695f9', squad: [] }
};
var src = {
markCard:
[ { i: 1,
bt: [Object],
bl: [Object],
ts: [Object],
sc: [Object] },
{ i: 2,
bt: [Object],
bl: [Object],
ts: [Object],
sc: [Object] …Run Code Online (Sandbox Code Playgroud) 我为我的mean-io堆栈应用程序运行gulp.
我得到以下错误.
13:15:54] Starting 'server'...
13:15:54] Finished 'server' after 47 ms
13:15:54] Live reload server listening on: 35729
.. Uhoh. Got error listen EADDRINUSE ...
rror: listen EADDRINUSE
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1039:14)
at listen (net.js:1061:10)
at Server.listen (net.js:1127:5)
Run Code Online (Sandbox Code Playgroud)
我猜其他应用程序正在使用端口35729.我对吗?我也尝试更改livereload.js中的端口号.但是,我得到了同样的错误.
以下是文件,我看到分配的35729端口号.如果要在任何地方更改端口号,请告诉我.
myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\lib\public\livereload.js:
321: this.port = 35829;
myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\lib\server.js
20: options.port = parseInt(options.port || 35729, 10);
myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\node_modules\noptify\index.js:
21: // .option('port', '-p', 'Port to listen on (default: 35729)', Number)
myApp\node_modules\grunt-contrib-watch\node_modules\tiny-lr-fork\bin\tiny-lr:
14: .option('port', '-p', 'Port to listen on (default: 35729)', Number)
18: opts.port …Run Code Online (Sandbox Code Playgroud)