Hi Experts,
I started my first Angularjs application site.
And started with an example from w3school, the angular app is started this way <body ng-app>
All the function i did work fine, and just to be clear, i didn't do any directives or modules yet, just plain function using tags scoopes.
But all the example i see use the ng-app with a name. I know that one of the goals is to have more than one app inside the html document, which not my case.
But my question is: Should i give a name to the app anyway? (<body ng-app="MyApp">)
For example how do i make a directive or a module with only <body ng-app> ?
like this?:
var module = angular.module('', [])
.directive('onFinishRender', function ($timeout) {
...
});
Will that work?
My functions are made directly like this, with no mention of the app:
function check_login($scope) {
$scope.check = function (message) {
return $scope.login;
}
}
What's the best practice? Will i have later problems if i don't identify my angularjs app with a name?
If what you have is already complex and you want to use AngularJS, make sure you use it properly, otherwise it will only become even messier.