我是否这样做:
(function () {
'use strict';
// Create the module and define its dependencies.
var app = angular.module('app', [
// Angular modules
'ngAnimate', // animations
'ngRoute' // routing
// Custom modules
// 3rd Party Modules
]);
// Execute bootstrapping code and any dependencies.
app.run(['$log',
function ($log) {
$log.log('we are loaded');
}]);
})();
Run Code Online (Sandbox Code Playgroud)
要么
'use strict';
// Create the module and define its dependencies.
var app = angular.module('app', [
// Angular modules
'ngAnimate', // animations
'ngRoute' // routing
// Custom modules …Run Code Online (Sandbox Code Playgroud) 使用Angularjs和UI-Router,尝试每次状态更改时运行一个函数
$rootScope.$on('$stateChangeStart',
function(toState){
if(toState !== 'login')
UsersService.redirect();
})
Run Code Online (Sandbox Code Playgroud)
我把它放在.run()中,每次路由更改时我都可以成功注销到State.但是,我似乎无法找到具有我们要去的州名称的财产.如果有人能告诉我在哪里找到它,我想我应该保持良好状态.
onLoginFinished的结果只是告诉我授予的权限.从repo,不清楚如何获取用户配置文件.看起来像react-native-fbsdkcore应该包装FBSDKProfile.h但是看不到它的作用.
var FBSDKLogin = require('react-native-fbsdklogin');
var {
FBSDKLoginButton,
} = FBSDKLogin;
var Login = React.createClass({
render: function() {
return (
<View>
<FBSDKLoginButton
onLoginFinished={(error, result) => {
if (error) {
alert('Error logging in.');
} else {
if (result.isCanceled) {
alert('Login cancelled.');
} else {
alert('Logged in.');
}
}
}}
onLogoutFinished={() => alert('Logged out.')}
readPermissions={[]}
publishPermissions={['publish_actions']}/>
</View>
);
}
});
Run Code Online (Sandbox Code Playgroud) 我正在执行标签的ng-repeat
<span class="label label-primary" style="margin-right:5px;" ng-repeat="a in data.tags">{{a.tagName}}</span>
Run Code Online (Sandbox Code Playgroud)
如果输出是许多标签,它会离开屏幕,而不是根据我所拥有的列表大小相应地进行换行.
参见示例:http://www.bootply.com/119412
是什么赋予了?
谢谢!
我有一个NoteBrief
public int Id { get; set; }
public string Title { get; set; }
public DateTime Created { get; set; }
public int ParentNoteId { get; set; }
Run Code Online (Sandbox Code Playgroud)
数据看起来像
1 Title1 03/31/1987 1
2 Title1 03/31/1988 1
3 Title3 01/01/2000 3
4 Title4 01/01/2001 4
5 Title4 01/01/2005 4
Run Code Online (Sandbox Code Playgroud)
我想要做:
SELECT t1.*
FROM Notes AS t1 LEFT JOIN Notes AS t2
ON (t1.ParentNoteId = t2.ParentNoteId AND t1.Created < t2.Created)
WHERE t2.Created IS NULL;
Run Code Online (Sandbox Code Playgroud)
现在我有:
public IQueryable<NoteBrief> GetNotes()
{
return …Run Code Online (Sandbox Code Playgroud) 是否有一种简单的方法来获取键值对的对象中的最后一个键,例如
var valuePair = {
key: value,
key2: value2,
key3: value3
}
var lastKey = getLastKey(valuePair);
console.log(lastKey);
//Prints 'key3'
Run Code Online (Sandbox Code Playgroud) 我需要学习如何使用String.Format在4个char字符串的中间插入冒号,例如1300 - > 13:00,或0500 - > 05:00