I have problem passing the variable declared from the scope to ng-init:
so far I have something like this:
$scope.x = '10';
<div ng-controller = "controller" ng-init="function(x)">
A lot of people will tell you you shouldn't do this (as mentioned in the docs here: https://docs.angularjs.org/api/ng/directive/ngInit).
As for actually doing it....
<div ng-controller="controller" ng-init="x = x">