I am working with MVC5 and angukarJS and i want to use angularJS material in mt project. I downloaded all the required packets but i am stuck at 1 point. Whenever i try to use ng-material my screen becomes blank.
var app = angular.module("myApp", []); it shows my form but CSS not showing.
var app = angular.module("myApp", ['ngmaterial']);Screen become blank.
Related
I have an Asp.net mvc site with Google adsense enabled with scripts added in the Layout.cs and contents getting generated via ajax and jquery from api. Everything was working fine and ads where showing
Recently I had added a new page where I used angularjs for databinding using CDN .and the page is working well.but ads stopped showing up. only on that page.the message showing on console is
The resource http://pagead2.googlesyndication.com/pagead/js/r20190313/r20190131/show_ads_impl.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
And in Layout.cs
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-1771190807684402",
enable_page_level_ads: true
});
</script>
Adding URL of my Site for reference
JumptoJob-Online exam
And my angularjs controller for page looks simple
<script>
"use strict";
/*We need to manually start angular as we need to
wait for the google charting libs to be ready*/
var mainApp = angular.module("mainApp", ['googlechart']);
mainApp.controller('QuestionController', myControllerFunction);
myControllerFunction.$inject = ["$scope", "$http", "$timeout"];
function myControllerFunction($scope, $http, $timeout) {
}
</script>
I contacted adsense support and provided the URL.they asked me to wait for some hours and then ad start showing. asper them its always better to use adsense directive with angularjs than just using normal adsense script and auto ads
On a particular website, there is an Angularjs app that I don't control. It's loaded on the HTML when I open the page. Let's call it app 1 :
<body data-ng-app="app1">.....</body>
My chrome plugin inserts an Angular 2 app in the HTML of the websites I visit. Let's call it app 2. I normally insert it with this code :
$('body').append('<app-root id="app-root"></app-root>');
platformBrowserDynamic().bootstrapModule(AppModule);
But this doesn't work.
==> The problem is, the Angularjs "app 1" is located directly in the body. So how can I insert my Anglular 2 "app 2" in the HTML, side-by-side?
I am not entirely sure if this will work (never tried angular 2 as a chrome extension app)
$('html').append('<app-root id="app-root"></app-root>');
platformBrowserDynamic().bootstrapModule(AppModule);
or create a div element and use insertAdjacentHTML inside the body with afterbegin position
https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML
I have one redhat cloud application which front-end developed in Angular.js 1.5.5, it works perfectly fine on windows desktop and android device browsers where only on ios mobile browsers chrome or safari it shows blank white page. When I put sample loading text under body tag I was able to see that but nothing rendered except loadig text. To serve static content it has Node-Hapi.js server which has just basic stuff and static folder path.
Below is application url -
http://restperformance-gunjankrs.rhcloud.com/
Change code line
let myApp = angular.module('myApp', ['blockUI']);
to
var myApp = angular.module('myApp', ['blockUI']);
as 'let' is not supported in strict mode on iOS and Safari.
var myApp = angular.module('myApp', ['blockUI']);
Also change those:
var requestObj = $scope.serviceData;
var req = {
am looking to use a forerunnerDB , as a standalone database and running an electron framework to create a desktop ,
am having problem implementing the bootstrapped process,
var ForerunnerDB = require('forerunnerdb');
var fdb = new ForerunnerDB();
am using angular as the frontend , and electron bootstrapping ,
angular.module('RDash')
.controller('MasterCtrl', ['$scope', '$cookieStore', MasterCtrl])
.controller('tableCtrl',['$scope', '$cookieStore', tableCtrl]);
var ForerunnerDB = require('forerunnerdb');
var fdb = new ForerunnerDB();
but i get require == undefined error , where do bootstrap the forerunner
The require() call is part of Node.js used to include modules for use. If you are trying to instantiate ForerunnerDB on the client-side or in a browser you need to include the file ./dist/fdb-all.min.js instead (which is included in the ForerunnerDB download) as described in the documentation here: https://github.com/Irrelon/ForerunnerDB#use-forerunnerdb-in-browser
In the index.html of your AngularJS app, put this in the <head> section before your angular scripts but after jQuery and other third party libraries:
<script src="./forerunnerdb/dist/fdb-all.min.js" type="text/javascript"></script>
Make sure you change the path of the file to wherever you have put ForerunnerDB.
Disclaimer: I am the creator of ForerunnerDB
I am new to this Django-Angular JS integration. I created few web pages in AngularJS, views were working fine. As soon as I integrated with Django, first I had to correct paths to work but still views are not working. The view part stays blank and also grows in length (as if it goes into some loop!). Any idea guys?
EDIT:
Below is the way I am calling the view inside verbatim section of index.html
<div ng-view=""></div>
My js config file:
'use strict';
var mainAngular = angular.module('bazaar',['ui.bootstrap', 'ngRoute', 'ngCookies']).run(function($http, $cookies) {
$http.defaults.headers.post['X-CSRFToken'] = $cookies.csrftoken;
});
mainAngular.config(function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: "../static/views/welcomeView.html"
})
I have just pasted the code which I am using for view call. Let me know if its helpful or you guys need more details.
Well, I found out the issue so thought to drop the answer as well so that It may be helpful for other newbies like me.
I was including js file in my view ealier (which was working completely fine when run as a separate page using Tomcat) , but as soon as I integrated with Django I had to remove all js file path from <script> tag and Bingo !!